diff --git a/api-test/src/lxc/mod.rs b/api-test/src/lxc/mod.rs index cb4e2ace..728719da 100644 --- a/api-test/src/lxc/mod.rs +++ b/api-test/src/lxc/mod.rs @@ -71,7 +71,7 @@ pub mod schema; \n\n\ NOTE: You can disable fair-scheduler configuration by setting this to 0.", minimum: 0, - maximum: 500000, + maximum: 500_000, default: 1024, }, memory: { diff --git a/api-test/src/lxc/schema/mod.rs b/api-test/src/lxc/schema/mod.rs index b934562d..dd3fe8db 100644 --- a/api-test/src/lxc/schema/mod.rs +++ b/api-test/src/lxc/schema/mod.rs @@ -40,9 +40,9 @@ pub enum ConsoleMode { } pub mod mount_options { - pub const NAME: &'static str = "mount options"; + pub const NAME: &str = "mount options"; - const VALID_MOUNT_OPTIONS: &[&'static str] = &["noatime", "nodev", "noexec", "nosuid"]; + const VALID_MOUNT_OPTIONS: &[&str] = &["noatime", "nodev", "noexec", "nosuid"]; pub fn verify(value: &T) -> bool { value.all(|s| VALID_MOUNT_OPTIONS.contains(&s)) diff --git a/api-test/src/schema/mod.rs b/api-test/src/schema/mod.rs index 62e74918..8c720f24 100644 --- a/api-test/src/schema/mod.rs +++ b/api-test/src/schema/mod.rs @@ -43,7 +43,7 @@ pub mod dns_name { use lazy_static::lazy_static; use regex::Regex; - pub const NAME: &'static str = "DNS name"; + pub const NAME: &str = "DNS name"; lazy_static! { //static ref DNS_BASE_RE: Regex = @@ -61,7 +61,7 @@ pub mod dns_name { } pub mod ip_address { - pub const NAME: &'static str = "IP Address"; + pub const NAME: &str = "IP Address"; pub fn verify(value: &T) -> bool { value.all(|s| proxmox::tools::common_regex::IP_REGEX.is_match(s)) @@ -69,7 +69,7 @@ pub mod ip_address { } pub mod safe_path { - pub const NAME: &'static str = "A canonical, absolute file system path"; + pub const NAME: &str = "A canonical, absolute file system path"; pub fn verify(value: &T) -> bool { value.all(|s| { diff --git a/proxmox-api-macro/src/api_macro/struct_types/named.rs b/proxmox-api-macro/src/api_macro/struct_types/named.rs index b60acc54..41a23afd 100644 --- a/proxmox-api-macro/src/api_macro/struct_types/named.rs +++ b/proxmox-api-macro/src/api_macro/struct_types/named.rs @@ -399,7 +399,7 @@ fn named_struct_derive_deserialize( } } - const FIELDS: &'static [&'static str] = &[ #field_name_str_list ]; + const FIELDS: &[&str] = &[ #field_name_str_list ]; deserializer.deserialize_struct(#type_str, FIELDS, #visitor_ident) } } @@ -423,7 +423,7 @@ fn named_struct_impl_accessors( pub fn #field_ident( &self, ) -> &<#field_ty as ::proxmox::api::meta::OrDefault>::Output { - const DEF: <#field_ty as ::proxmox::api::meta::OrDefault>::Output = #default; + static DEF: <#field_ty as ::proxmox::api::meta::OrDefault>::Output = #default; ::proxmox::api::meta::OrDefault::or_default(&self.#field_ident, &DEF) }