1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-05-13 21:26:27 +02:00

style: fix rust-analyzer lints in core

This commit is contained in:
Andrew Gallant 2020-03-15 09:04:39 -04:00
parent 7340d8dbbe
commit 1856cda77b
No known key found for this signature in database
GPG Key ID: B2E3A4923F8B0D44
5 changed files with 15 additions and 20 deletions

View File

@ -297,14 +297,11 @@ impl RGArg {
fn positional(name: &'static str, value_name: &'static str) -> RGArg { fn positional(name: &'static str, value_name: &'static str) -> RGArg {
RGArg { RGArg {
claparg: Arg::with_name(name).value_name(value_name), claparg: Arg::with_name(name).value_name(value_name),
name: name, name,
doc_short: "", doc_short: "",
doc_long: "", doc_long: "",
hidden: false, hidden: false,
kind: RGArgKind::Positional { kind: RGArgKind::Positional { value_name, multiple: false },
value_name: value_name,
multiple: false,
},
} }
} }
@ -319,7 +316,7 @@ impl RGArg {
fn switch(long_name: &'static str) -> RGArg { fn switch(long_name: &'static str) -> RGArg {
let claparg = Arg::with_name(long_name).long(long_name); let claparg = Arg::with_name(long_name).long(long_name);
RGArg { RGArg {
claparg: claparg, claparg,
name: long_name, name: long_name,
doc_short: "", doc_short: "",
doc_long: "", doc_long: "",
@ -349,7 +346,7 @@ impl RGArg {
.takes_value(true) .takes_value(true)
.number_of_values(1); .number_of_values(1);
RGArg { RGArg {
claparg: claparg, claparg,
name: long_name, name: long_name,
doc_short: "", doc_short: "",
doc_long: "", doc_long: "",
@ -357,7 +354,7 @@ impl RGArg {
kind: RGArgKind::Flag { kind: RGArgKind::Flag {
long: long_name, long: long_name,
short: None, short: None,
value_name: value_name, value_name,
multiple: false, multiple: false,
possible_values: vec![], possible_values: vec![],
}, },

View File

@ -394,11 +394,11 @@ enum SortByKind {
impl SortBy { impl SortBy {
fn asc(kind: SortByKind) -> SortBy { fn asc(kind: SortByKind) -> SortBy {
SortBy { reverse: false, kind: kind } SortBy { reverse: false, kind }
} }
fn desc(kind: SortByKind) -> SortBy { fn desc(kind: SortByKind) -> SortBy {
SortBy { reverse: true, kind: kind } SortBy { reverse: true, kind }
} }
fn none() -> SortBy { fn none() -> SortBy {
@ -559,10 +559,10 @@ impl ArgMatches {
}; };
Ok(Args(Arc::new(ArgsImp { Ok(Args(Arc::new(ArgsImp {
matches: self, matches: self,
patterns: patterns, patterns,
matcher: matcher, matcher,
paths: paths, paths,
using_default_path: using_default_path, using_default_path,
}))) })))
} }
} }

View File

@ -37,7 +37,7 @@ impl PathPrinterBuilder {
/// Create a new path printer with the current configuration that writes /// Create a new path printer with the current configuration that writes
/// paths to the given writer. /// paths to the given writer.
pub fn build<W: WriteColor>(&self, wtr: W) -> PathPrinter<W> { 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. /// Set the color specification for this printer.

View File

@ -70,7 +70,7 @@ impl SearchWorkerBuilder {
SearchWorkerBuilder { SearchWorkerBuilder {
config: Config::default(), config: Config::default(),
command_builder: cmd_builder, command_builder: cmd_builder,
decomp_builder: decomp_builder, decomp_builder,
} }
} }

View File

@ -50,10 +50,8 @@ impl SubjectBuilder {
/// If a subject could not be created or should otherwise not be searched, /// If a subject could not be created or should otherwise not be searched,
/// then this returns `None` after emitting any relevant log messages. /// then this returns `None` after emitting any relevant log messages.
pub fn build(&self, dent: DirEntry) -> Option<Subject> { pub fn build(&self, dent: DirEntry) -> Option<Subject> {
let subj = Subject { let subj =
dent: dent, Subject { dent, strip_dot_prefix: self.config.strip_dot_prefix };
strip_dot_prefix: self.config.strip_dot_prefix,
};
if let Some(ignore_err) = subj.dent.error() { if let Some(ignore_err) = subj.dent.error() {
ignore_message!("{}", ignore_err); ignore_message!("{}", ignore_err);
} }