From 1856cda77be5bd4cd505e63f32816e4cb14be8cc Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 15 Mar 2020 09:04:39 -0400 Subject: style: fix rust-analyzer lints in core --- crates/core/app.rs | 13 +++++-------- crates/core/args.rs | 12 ++++++------ crates/core/path_printer.rs | 2 +- crates/core/search.rs | 2 +- crates/core/subject.rs | 6 ++---- 5 files changed, 15 insertions(+), 20 deletions(-) (limited to 'crates') diff --git a/crates/core/app.rs b/crates/core/app.rs index 7031d804..f6af7993 100644 --- a/crates/core/app.rs +++ b/crates/core/app.rs @@ -297,14 +297,11 @@ impl RGArg { fn positional(name: &'static str, value_name: &'static str) -> RGArg { RGArg { claparg: Arg::with_name(name).value_name(value_name), - name: name, + name, doc_short: "", doc_long: "", hidden: false, - kind: RGArgKind::Positional { - value_name: value_name, - multiple: false, - }, + kind: RGArgKind::Positional { value_name, multiple: false }, } } @@ -319,7 +316,7 @@ impl RGArg { fn switch(long_name: &'static str) -> RGArg { let claparg = Arg::with_name(long_name).long(long_name); RGArg { - claparg: claparg, + claparg, name: long_name, doc_short: "", doc_long: "", @@ -349,7 +346,7 @@ impl RGArg { .takes_value(true) .number_of_values(1); RGArg { - claparg: claparg, + claparg, name: long_name, doc_short: "", doc_long: "", @@ -357,7 +354,7 @@ impl RGArg { kind: RGArgKind::Flag { long: long_name, short: None, - value_name: value_name, + value_name, multiple: false, possible_values: vec![], }, diff --git a/crates/core/args.rs b/crates/core/args.rs index 989f95c2..d99e777d 100644 --- a/crates/core/args.rs +++ b/crates/core/args.rs @@ -394,11 +394,11 @@ enum SortByKind { impl SortBy { fn asc(kind: SortByKind) -> SortBy { - SortBy { reverse: false, kind: kind } + SortBy { reverse: false, kind } } fn desc(kind: SortByKind) -> SortBy { - SortBy { reverse: true, kind: kind } + SortBy { reverse: true, kind } } fn none() -> SortBy { @@ -559,10 +559,10 @@ impl ArgMatches { }; Ok(Args(Arc::new(ArgsImp { matches: self, - patterns: patterns, - matcher: matcher, - paths: paths, - using_default_path: using_default_path, + patterns, + matcher, + paths, + using_default_path, }))) } } diff --git a/crates/core/path_printer.rs b/crates/core/path_printer.rs index 59cadbc8..b964a84a 100644 --- a/crates/core/path_printer.rs +++ b/crates/core/path_printer.rs @@ -37,7 +37,7 @@ impl PathPrinterBuilder { /// Create a new path printer with the current configuration that writes /// paths to the given writer. pub fn build(&self, wtr: W) -> PathPrinter { - PathPrinter { config: self.config.clone(), wtr: wtr } + PathPrinter { config: self.config.clone(), wtr } } /// Set the color specification for this printer. diff --git a/crates/core/search.rs b/crates/core/search.rs index af398da2..4da4057b 100644 --- a/crates/core/search.rs +++ b/crates/core/search.rs @@ -70,7 +70,7 @@ impl SearchWorkerBuilder { SearchWorkerBuilder { config: Config::default(), command_builder: cmd_builder, - decomp_builder: decomp_builder, + decomp_builder, } } diff --git a/crates/core/subject.rs b/crates/core/subject.rs index d70c1a6c..007f49de 100644 --- a/crates/core/subject.rs +++ b/crates/core/subject.rs @@ -50,10 +50,8 @@ impl SubjectBuilder { /// If a subject could not be created or should otherwise not be searched, /// then this returns `None` after emitting any relevant log messages. pub fn build(&self, dent: DirEntry) -> Option { - let subj = Subject { - dent: dent, - strip_dot_prefix: self.config.strip_dot_prefix, - }; + let subj = + Subject { dent, strip_dot_prefix: self.config.strip_dot_prefix }; if let Some(ignore_err) = subj.dent.error() { ignore_message!("{}", ignore_err); } -- cgit v1.2.3