mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-16 00:48:28 +01:00
Merge pull request #1168 from tmccombs/clippy-fixes-2
Fix some warnings from clippy
This commit is contained in:
commit
9e88f91c22
2 changed files with 4 additions and 4 deletions
|
@ -807,7 +807,7 @@ impl clap::Args for Exec {
|
||||||
.allow_hyphen_values(true)
|
.allow_hyphen_values(true)
|
||||||
.value_terminator(";")
|
.value_terminator(";")
|
||||||
.value_name("cmd")
|
.value_name("cmd")
|
||||||
.conflicts_with_all(&["exec", "list_details"])
|
.conflicts_with_all(["exec", "list_details"])
|
||||||
.help("Execute a command with all search results at once")
|
.help("Execute a command with all search results at once")
|
||||||
.long_help(
|
.long_help(
|
||||||
"Execute the given command once, with all search results as arguments.\n\
|
"Execute the given command once, with all search results as arguments.\n\
|
||||||
|
|
|
@ -148,7 +148,7 @@ impl CommandBuilder {
|
||||||
for arg in &template.args {
|
for arg in &template.args {
|
||||||
if arg.has_tokens() {
|
if arg.has_tokens() {
|
||||||
path_arg = Some(arg.clone());
|
path_arg = Some(arg.clone());
|
||||||
} else if path_arg == None {
|
} else if path_arg.is_none() {
|
||||||
pre_args.push(arg.generate("", None));
|
pre_args.push(arg.generate("", None));
|
||||||
} else {
|
} else {
|
||||||
post_args.push(arg.generate("", None));
|
post_args.push(arg.generate("", None));
|
||||||
|
@ -301,9 +301,9 @@ impl CommandTemplate {
|
||||||
/// Using the internal `args` field, and a supplied `input` variable, a `Command` will be
|
/// Using the internal `args` field, and a supplied `input` variable, a `Command` will be
|
||||||
/// build.
|
/// build.
|
||||||
fn generate(&self, input: &Path, path_separator: Option<&str>) -> io::Result<Command> {
|
fn generate(&self, input: &Path, path_separator: Option<&str>) -> io::Result<Command> {
|
||||||
let mut cmd = Command::new(self.args[0].generate(&input, path_separator));
|
let mut cmd = Command::new(self.args[0].generate(input, path_separator));
|
||||||
for arg in &self.args[1..] {
|
for arg in &self.args[1..] {
|
||||||
cmd.try_arg(arg.generate(&input, path_separator))?;
|
cmd.try_arg(arg.generate(input, path_separator))?;
|
||||||
}
|
}
|
||||||
Ok(cmd)
|
Ok(cmd)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue