diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index fbd01fc4..0af11b33 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -158,7 +158,7 @@ pub const PRUNE_SCHEMA_KEEP_YEARLY: Schema = .schema(); #[api] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// The order to sort chunks by pub enum ChunkOrder { @@ -357,7 +357,7 @@ pub struct BackupContent { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// Result of a verify operation. pub enum VerifyState { @@ -1397,7 +1397,7 @@ pub fn parse_ns_and_snapshot(input: &str) -> Result<(BackupNamespace, BackupDir) match input.rmatch_indices('/').nth(2) { Some((idx, _)) => { let ns = BackupNamespace::from_path(&input[..idx])?; - let dir: BackupDir = (&input[idx + 1..]).parse()?; + let dir: BackupDir = input[(idx + 1)..].parse()?; Ok((ns, dir)) } None => Ok((BackupNamespace::root(), input.parse()?)), diff --git a/pbs-api-types/src/human_byte.rs b/pbs-api-types/src/human_byte.rs index 532632c8..37a74f77 100644 --- a/pbs-api-types/src/human_byte.rs +++ b/pbs-api-types/src/human_byte.rs @@ -3,7 +3,7 @@ use anyhow::{bail, Error}; use proxmox_schema::{ApiStringFormat, ApiType, Schema, StringSchema, UpdaterType}; /// Size units for byte sizes -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum SizeUnit { Byte, // SI (base 10) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 925a1829..e4be03f0 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -102,7 +102,7 @@ pub struct JobScheduleStatus { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// When do we send notifications pub enum Notify { diff --git a/pbs-api-types/src/lib.rs b/pbs-api-types/src/lib.rs index 70c9ec45..18cde45e 100644 --- a/pbs-api-types/src/lib.rs +++ b/pbs-api-types/src/lib.rs @@ -401,7 +401,7 @@ pub struct APTUpdateInfo { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// Node Power command type. pub enum NodePowerCommand { diff --git a/pbs-api-types/src/maintenance.rs b/pbs-api-types/src/maintenance.rs index 5bbba043..7eb33963 100644 --- a/pbs-api-types/src/maintenance.rs +++ b/pbs-api-types/src/maintenance.rs @@ -33,7 +33,7 @@ pub enum Operation { } #[api] -#[derive(Deserialize, Serialize, PartialEq)] +#[derive(Deserialize, Serialize, PartialEq, Eq)] #[serde(rename_all = "kebab-case")] /// Maintenance type. pub enum MaintenanceType { diff --git a/pbs-api-types/src/network.rs b/pbs-api-types/src/network.rs index dda0db1b..4b0671c5 100644 --- a/pbs-api-types/src/network.rs +++ b/pbs-api-types/src/network.rs @@ -42,7 +42,7 @@ pub const CIDR_SCHEMA: Schema = .schema(); #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// Interface configuration method pub enum NetworkConfigMethod { @@ -57,7 +57,7 @@ pub enum NetworkConfigMethod { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] #[allow(non_camel_case_types)] #[repr(u8)] @@ -81,7 +81,7 @@ pub enum LinuxBondMode { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] #[allow(non_camel_case_types)] #[repr(u8)] @@ -98,7 +98,7 @@ pub enum BondXmitHashPolicy { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// Network interface type pub enum NetworkInterfaceType { diff --git a/pbs-api-types/src/tape/media_location.rs b/pbs-api-types/src/tape/media_location.rs index b81ea9a8..608460b5 100644 --- a/pbs-api-types/src/tape/media_location.rs +++ b/pbs-api-types/src/tape/media_location.rs @@ -10,7 +10,7 @@ pub const VAULT_NAME_SCHEMA: Schema = StringSchema::new("Vault name.") .max_length(32) .schema(); -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// Media location pub enum MediaLocation { /// Ready for use (inside tape library) diff --git a/pbs-api-types/src/tape/media_status.rs b/pbs-api-types/src/tape/media_status.rs index 9815b91f..fdb4e6a0 100644 --- a/pbs-api-types/src/tape/media_status.rs +++ b/pbs-api-types/src/tape/media_status.rs @@ -4,7 +4,7 @@ use proxmox_schema::api; #[api()] /// Media status -#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// Media Status pub enum MediaStatus { diff --git a/pbs-api-types/src/userid.rs b/pbs-api-types/src/userid.rs index ecbae9c2..996e96e5 100644 --- a/pbs-api-types/src/userid.rs +++ b/pbs-api-types/src/userid.rs @@ -316,7 +316,7 @@ impl PartialEq for RealmRef { impl PartialEq for &RealmRef { fn eq(&self, rhs: &Realm) -> bool { - (*self).0 == rhs.0 + self.0 == rhs.0 } } @@ -453,7 +453,7 @@ impl Userid { /// Get the "root@pam" user id. pub fn root_userid() -> &'static Self { - &*ROOT_USERID + &ROOT_USERID } } @@ -586,7 +586,7 @@ impl Authid { /// Get the "root@pam" auth id. pub fn root_auth_id() -> &'static Self { - &*ROOT_AUTHID + &ROOT_AUTHID } } diff --git a/pbs-api-types/src/zfs.rs b/pbs-api-types/src/zfs.rs index b62af6cb..57fa5cf4 100644 --- a/pbs-api-types/src/zfs.rs +++ b/pbs-api-types/src/zfs.rs @@ -17,7 +17,7 @@ pub const ZPOOL_NAME_SCHEMA: Schema = StringSchema::new("ZFS Pool Name") .schema(); #[api(default: "On")] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// The ZFS compression algorithm to use. pub enum ZfsCompressionType { @@ -38,7 +38,7 @@ pub enum ZfsCompressionType { } #[api()] -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")] /// The ZFS RAID level to use. pub enum ZfsRaidLevel {