summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2020-03-15 09:04:39 -0400
committerAndrew Gallant <jamslam@gmail.com>2020-03-15 09:04:54 -0400
commit1856cda77be5bd4cd505e63f32816e4cb14be8cc (patch)
tree4eb554c0e9b73103cea482c96b1409a313619d27
parent7340d8dbbe59e3c4d942f71e5a9aed4e0dae1269 (diff)
style: fix rust-analyzer lints in core
-rw-r--r--crates/core/app.rs13
-rw-r--r--crates/core/args.rs12
-rw-r--r--crates/core/path_printer.rs2
-rw-r--r--crates/core/search.rs2
-rw-r--r--crates/core/subject.rs6
5 files changed, 15 insertions, 20 deletions
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<W: WriteColor>(&self, wtr: W) -> PathPrinter<W> {
- 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<Subject> {
- 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);
}