mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-17 09:28:25 +01:00
Fix clippy suggestions
This commit is contained in:
parent
ea48a96945
commit
296300ce46
2 changed files with 3 additions and 3 deletions
2
build.rs
2
build.rs
|
@ -16,7 +16,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));
|
let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or_else(|| std::env::var_os("OUT_DIR"));
|
||||||
let outdir = match var {
|
let outdir = match var {
|
||||||
None => return,
|
None => return,
|
||||||
Some(outdir) => outdir,
|
Some(outdir) => outdir,
|
||||||
|
|
|
@ -176,7 +176,7 @@ fn run() -> Result<ExitCode> {
|
||||||
let path_separator = matches.value_of("path-separator").map(|str| str.to_owned());
|
let path_separator = matches.value_of("path-separator").map(|str| str.to_owned());
|
||||||
|
|
||||||
let ls_colors = if colored_output {
|
let ls_colors = if colored_output {
|
||||||
Some(LsColors::from_env().unwrap_or(LsColors::from_string(DEFAULT_LS_COLORS)))
|
Some(LsColors::from_env().unwrap_or_else(|| LsColors::from_string(DEFAULT_LS_COLORS)))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
@ -344,7 +344,7 @@ fn run() -> Result<ExitCode> {
|
||||||
.value_of("threads")
|
.value_of("threads")
|
||||||
.map(|n| usize::from_str_radix(n, 10))
|
.map(|n| usize::from_str_radix(n, 10))
|
||||||
.transpose()
|
.transpose()
|
||||||
.context(format!("Failed to parse number of threads"))?
|
.context("Failed to parse number of threads")?
|
||||||
.map(|n| {
|
.map(|n| {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
Ok(n)
|
Ok(n)
|
||||||
|
|
Loading…
Reference in a new issue