From 082c82268452b768f5d8dad30589c7f45d453c72 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Sun, 13 Feb 2022 23:10:42 +0530 Subject: [PATCH] Fix clippy lints from rust upgrade --- src/flags/date.rs | 6 +++--- src/meta/date.rs | 6 +++--- src/meta/mod.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/flags/date.rs b/src/flags/date.rs index 2a7f1ec..2f1195d 100644 --- a/src/flags/date.rs +++ b/src/flags/date.rs @@ -14,7 +14,7 @@ use clap::ArgMatches; pub enum DateFlag { Date, Relative, - ISO, + Iso, Formatted(String), } @@ -91,7 +91,7 @@ impl Configurable for DateFlag { match value.as_str() { "full-iso" => Some(Self::Formatted("%F %T.%f %z".into())), "long-iso" => Some(Self::Formatted("%F %R".into())), - "iso" => Some(Self::ISO), + "iso" => Some(Self::Iso), _ if value.starts_with('+') => Self::from_format_string(&value), _ => { print_error!("Not a valid date value: {}.", value); @@ -251,7 +251,7 @@ mod test { #[serial_test::serial] fn test_from_environment_iso() { std::env::set_var("TIME_STYLE", "iso"); - assert_eq!(Some(DateFlag::ISO), DateFlag::from_environment()); + assert_eq!(Some(DateFlag::Iso), DateFlag::from_environment()); } #[test] diff --git a/src/meta/date.rs b/src/meta/date.rs index f6b3a6e..1489aec 100644 --- a/src/meta/date.rs +++ b/src/meta/date.rs @@ -56,7 +56,7 @@ impl Date { match &flags.date { DateFlag::Date => val.format("%c").to_string(), DateFlag::Relative => format!("{}", HumanTime::from(*val - Local::now())), - DateFlag::ISO => { + DateFlag::Iso => { // 365.2425 * 24 * 60 * 60 = 31556952 seconds per year // 15778476 seconds are 6 months if *val > Local::now() - Duration::seconds(15_778_476) { @@ -267,7 +267,7 @@ mod test { let date = Date::from(&file_path.metadata().unwrap()); let mut flags = Flags::default(); - flags.date = DateFlag::ISO; + flags.date = DateFlag::Iso; assert_eq!( creation_date @@ -295,7 +295,7 @@ mod test { let date = Date::from(&file_path.metadata().unwrap()); let mut flags = Flags::default(); - flags.date = DateFlag::ISO; + flags.date = DateFlag::Iso; assert_eq!( creation_date diff --git a/src/meta/mod.rs b/src/meta/mod.rs index 72da1c3..d78a6b9 100644 --- a/src/meta/mod.rs +++ b/src/meta/mod.rs @@ -225,7 +225,7 @@ impl Meta { let permissions = Permissions::from(&metadata); #[cfg(windows)] - let (owner, permissions) = windows_utils::get_file_data(&path)?; + let (owner, permissions) = windows_utils::get_file_data(path)?; let file_type = FileType::new(&metadata, symlink_meta.as_ref(), &permissions); let name = Name::new(path, file_type);