mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-05 02:55:31 +00:00
chore(build.rs): Fix clippy warnings
This commit is contained in:
parent
890d89a96f
commit
75ae1e28d5
10
build.rs
10
build.rs
@ -33,7 +33,7 @@
|
||||
/// - `target/debug/build/ouch-195b34a8adca6ec3/out/completions`
|
||||
///
|
||||
/// The _"195b34a8adca6ec3"_ part is a hash that might change between runs.
|
||||
use std::{env, ffi::OsStr, fs::create_dir_all, path::Path};
|
||||
use std::{env, fs::create_dir_all, path::Path};
|
||||
|
||||
use clap::{ArgEnum, IntoApp};
|
||||
use clap_complete::{generate_to, Shell};
|
||||
@ -64,12 +64,12 @@ fn detect_completions_output_directory() -> Option<PathBuf> {
|
||||
};
|
||||
|
||||
// If set, directory goes inside of cargo's `target/`
|
||||
let gen_completions = env::var_os("GEN_COMPLETIONS").map(|var| &var == OsStr::new("1")).unwrap_or(false);
|
||||
let gen_completions = env::var_os("GEN_COMPLETIONS").map(|var| &var == "1").unwrap_or(false);
|
||||
if gen_completions {
|
||||
let out_dir = env::var_os("OUT_DIR").unwrap();
|
||||
let dir = Path::new(&out_dir).join("completions");
|
||||
return Some(dir);
|
||||
Some(dir)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
return None;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user