From 75ae1e28d55609c04730f3088f879dc73fc5d38f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Sun, 20 Mar 2022 12:51:19 -0300 Subject: [PATCH] chore(build.rs): Fix clippy warnings --- build.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.rs b/build.rs index 72c42c7..aa54539 100644 --- a/build.rs +++ b/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 { }; // 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; } -- 2.11.4.GIT