[clippy] api-test: remove unnecessary lifetimes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-08-22 09:15:03 +02:00
parent d06b2b277c
commit 7f2ae4f272
4 changed files with 8 additions and 8 deletions

View File

@ -71,7 +71,7 @@ pub mod schema;
\n\n\ \n\n\
NOTE: You can disable fair-scheduler configuration by setting this to 0.", NOTE: You can disable fair-scheduler configuration by setting this to 0.",
minimum: 0, minimum: 0,
maximum: 500000, maximum: 500_000,
default: 1024, default: 1024,
}, },
memory: { memory: {

View File

@ -40,9 +40,9 @@ pub enum ConsoleMode {
} }
pub mod mount_options { 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<T: crate::schema::tools::StringContainer>(value: &T) -> bool { pub fn verify<T: crate::schema::tools::StringContainer>(value: &T) -> bool {
value.all(|s| VALID_MOUNT_OPTIONS.contains(&s)) value.all(|s| VALID_MOUNT_OPTIONS.contains(&s))

View File

@ -43,7 +43,7 @@ pub mod dns_name {
use lazy_static::lazy_static; use lazy_static::lazy_static;
use regex::Regex; use regex::Regex;
pub const NAME: &'static str = "DNS name"; pub const NAME: &str = "DNS name";
lazy_static! { lazy_static! {
//static ref DNS_BASE_RE: Regex = //static ref DNS_BASE_RE: Regex =
@ -61,7 +61,7 @@ pub mod dns_name {
} }
pub mod ip_address { pub mod ip_address {
pub const NAME: &'static str = "IP Address"; pub const NAME: &str = "IP Address";
pub fn verify<T: crate::schema::tools::StringContainer>(value: &T) -> bool { pub fn verify<T: crate::schema::tools::StringContainer>(value: &T) -> bool {
value.all(|s| proxmox::tools::common_regex::IP_REGEX.is_match(s)) 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 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<T: crate::schema::tools::StringContainer>(value: &T) -> bool { pub fn verify<T: crate::schema::tools::StringContainer>(value: &T) -> bool {
value.all(|s| { value.all(|s| {

View File

@ -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) deserializer.deserialize_struct(#type_str, FIELDS, #visitor_ident)
} }
} }
@ -423,7 +423,7 @@ fn named_struct_impl_accessors(
pub fn #field_ident( pub fn #field_ident(
&self, &self,
) -> &<#field_ty as ::proxmox::api::meta::OrDefault>::Output { ) -> &<#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) ::proxmox::api::meta::OrDefault::or_default(&self.#field_ident, &DEF)
} }