Skip to content
Myr

Fix clippy suggestions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent ea48a96 · Browse files · 2 files+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−3 removed

  • other:+3 added−3 removed

2 files+3 added−3 removed

modified:src/main.rs+2 added-2 removed
174 unmodified lines
175176 let path_separator = matches.value_of("path-separator").map(|str| str.to_owned());177178 let ls_colors = if colored_output {179 Some(LsColors::from_env().unwrap_or(LsColors::from_string(DEFAULT_LS_COLORS)))179 Some(LsColors::from_env().unwrap_or_else(|| LsColors::from_string(DEFAULT_LS_COLORS)))180 } else {181 None182 };183
159 unmodified lines
343 matches344 .value_of("threads")345 .map(|n| usize::from_str_radix(n, 10))346 .transpose()347 .context(format!("Failed to parse number of threads"))?347 .context("Failed to parse number of threads")?348 .map(|n| {349 if n > 0 {350 Ok(n)351 } else {
110 unmodified lines
modified:build.rs+1 added-1 removed
14 unmodified lines
15 std::process::exit(1);16 }17 }1819 let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or(std::env::var_os("OUT_DIR"));19 let var = std::env::var_os("SHELL_COMPLETIONS_DIR").or_else(|| std::env::var_os("OUT_DIR"));20 let outdir = match var {21 None => return,22 Some(outdir) => outdir,23 };
7 unmodified lines