mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-01-29 22:01:04 +02:00
style: fix rust-analyzer lints in core
This commit is contained in:
parent
7340d8dbbe
commit
1856cda77b
@ -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![],
|
||||
},
|
||||
|
@ -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,
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -70,7 +70,7 @@ impl SearchWorkerBuilder {
|
||||
SearchWorkerBuilder {
|
||||
config: Config::default(),
|
||||
command_builder: cmd_builder,
|
||||
decomp_builder: decomp_builder,
|
||||
decomp_builder,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user