mirror of
https://git.proxmox.com/git/proxmox
synced 2025-05-21 16:10:47 +00:00
api-types: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
74092debc5
commit
3d670c9e4e
@ -158,7 +158,7 @@ pub const PRUNE_SCHEMA_KEEP_YEARLY: Schema =
|
|||||||
.schema();
|
.schema();
|
||||||
|
|
||||||
#[api]
|
#[api]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// The order to sort chunks by
|
/// The order to sort chunks by
|
||||||
pub enum ChunkOrder {
|
pub enum ChunkOrder {
|
||||||
@ -357,7 +357,7 @@ pub struct BackupContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// Result of a verify operation.
|
/// Result of a verify operation.
|
||||||
pub enum VerifyState {
|
pub enum VerifyState {
|
||||||
@ -1397,7 +1397,7 @@ pub fn parse_ns_and_snapshot(input: &str) -> Result<(BackupNamespace, BackupDir)
|
|||||||
match input.rmatch_indices('/').nth(2) {
|
match input.rmatch_indices('/').nth(2) {
|
||||||
Some((idx, _)) => {
|
Some((idx, _)) => {
|
||||||
let ns = BackupNamespace::from_path(&input[..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))
|
Ok((ns, dir))
|
||||||
}
|
}
|
||||||
None => Ok((BackupNamespace::root(), input.parse()?)),
|
None => Ok((BackupNamespace::root(), input.parse()?)),
|
||||||
|
@ -3,7 +3,7 @@ use anyhow::{bail, Error};
|
|||||||
use proxmox_schema::{ApiStringFormat, ApiType, Schema, StringSchema, UpdaterType};
|
use proxmox_schema::{ApiStringFormat, ApiType, Schema, StringSchema, UpdaterType};
|
||||||
|
|
||||||
/// Size units for byte sizes
|
/// Size units for byte sizes
|
||||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||||
pub enum SizeUnit {
|
pub enum SizeUnit {
|
||||||
Byte,
|
Byte,
|
||||||
// SI (base 10)
|
// SI (base 10)
|
||||||
|
@ -102,7 +102,7 @@ pub struct JobScheduleStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// When do we send notifications
|
/// When do we send notifications
|
||||||
pub enum Notify {
|
pub enum Notify {
|
||||||
|
@ -401,7 +401,7 @@ pub struct APTUpdateInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// Node Power command type.
|
/// Node Power command type.
|
||||||
pub enum NodePowerCommand {
|
pub enum NodePowerCommand {
|
||||||
|
@ -33,7 +33,7 @@ pub enum Operation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api]
|
#[api]
|
||||||
#[derive(Deserialize, Serialize, PartialEq)]
|
#[derive(Deserialize, Serialize, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
/// Maintenance type.
|
/// Maintenance type.
|
||||||
pub enum MaintenanceType {
|
pub enum MaintenanceType {
|
||||||
|
@ -42,7 +42,7 @@ pub const CIDR_SCHEMA: Schema =
|
|||||||
.schema();
|
.schema();
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// Interface configuration method
|
/// Interface configuration method
|
||||||
pub enum NetworkConfigMethod {
|
pub enum NetworkConfigMethod {
|
||||||
@ -57,7 +57,7 @@ pub enum NetworkConfigMethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
@ -81,7 +81,7 @@ pub enum LinuxBondMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
@ -98,7 +98,7 @@ pub enum BondXmitHashPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// Network interface type
|
/// Network interface type
|
||||||
pub enum NetworkInterfaceType {
|
pub enum NetworkInterfaceType {
|
||||||
|
@ -10,7 +10,7 @@ pub const VAULT_NAME_SCHEMA: Schema = StringSchema::new("Vault name.")
|
|||||||
.max_length(32)
|
.max_length(32)
|
||||||
.schema();
|
.schema();
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||||
/// Media location
|
/// Media location
|
||||||
pub enum MediaLocation {
|
pub enum MediaLocation {
|
||||||
/// Ready for use (inside tape library)
|
/// Ready for use (inside tape library)
|
||||||
|
@ -4,7 +4,7 @@ use proxmox_schema::api;
|
|||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
/// Media status
|
/// Media status
|
||||||
#[derive(Debug, PartialEq, Copy, Clone, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// Media Status
|
/// Media Status
|
||||||
pub enum MediaStatus {
|
pub enum MediaStatus {
|
||||||
|
@ -316,7 +316,7 @@ impl PartialEq<Realm> for RealmRef {
|
|||||||
|
|
||||||
impl PartialEq<Realm> for &RealmRef {
|
impl PartialEq<Realm> for &RealmRef {
|
||||||
fn eq(&self, rhs: &Realm) -> bool {
|
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.
|
/// Get the "root@pam" user id.
|
||||||
pub fn root_userid() -> &'static Self {
|
pub fn root_userid() -> &'static Self {
|
||||||
&*ROOT_USERID
|
&ROOT_USERID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ impl Authid {
|
|||||||
|
|
||||||
/// Get the "root@pam" auth id.
|
/// Get the "root@pam" auth id.
|
||||||
pub fn root_auth_id() -> &'static Self {
|
pub fn root_auth_id() -> &'static Self {
|
||||||
&*ROOT_AUTHID
|
&ROOT_AUTHID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ pub const ZPOOL_NAME_SCHEMA: Schema = StringSchema::new("ZFS Pool Name")
|
|||||||
.schema();
|
.schema();
|
||||||
|
|
||||||
#[api(default: "On")]
|
#[api(default: "On")]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// The ZFS compression algorithm to use.
|
/// The ZFS compression algorithm to use.
|
||||||
pub enum ZfsCompressionType {
|
pub enum ZfsCompressionType {
|
||||||
@ -38,7 +38,7 @@ pub enum ZfsCompressionType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[api()]
|
#[api()]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
/// The ZFS RAID level to use.
|
/// The ZFS RAID level to use.
|
||||||
pub enum ZfsRaidLevel {
|
pub enum ZfsRaidLevel {
|
||||||
|
Loading…
Reference in New Issue
Block a user