From f6f641350eb78b0ab15d13414cf978074b3031df Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sun, 29 Dec 2024 08:55:57 +0000 Subject: [PATCH] Clippy --- src/windows/find_tools.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/windows/find_tools.rs b/src/windows/find_tools.rs index b66139f4..992faaf4 100644 --- a/src/windows/find_tools.rs +++ b/src/windows/find_tools.rs @@ -38,7 +38,7 @@ enum TargetArch { Arm64ec, } impl TargetArch { - /// Parse the TargetArch from a str. Returns `None` if the arch is unrecognized. + /// Parse the `TargetArch` from a str. Returns `None` if the arch is unrecognized. fn new(arch: &str) -> Option { match arch { "x64" | "x86_64" => Some(Self::X64), @@ -155,9 +155,7 @@ pub(crate) fn find_tool_inner( env_getter: &dyn EnvGetter, ) -> Option { // We only need the arch. - let Some(target) = TargetArch::new(full_arch) else { - return None; - }; + let target = TargetArch::new(full_arch)?; // Looks like msbuild isn't located in the same location as other tools like // cl.exe and lib.exe. @@ -298,7 +296,7 @@ mod impl_ { /// # SAFETY /// /// The caller must ensure that the function signature matches the actual function. - /// The easiest way to do this is to add an entry to windows_sys_no_link.list and use the + /// The easiest way to do this is to add an entry to `windows_sys_no_link.list` and use the /// generated function for `func_signature`. /// /// The function returned cannot be used after the handle is dropped. @@ -394,7 +392,7 @@ mod impl_ { Some(target.as_vs_arch() == cmd_target) } - /// Detect the target architecture of `cl.exe`` in the current path, and return `None` if this + /// Detect the target architecture of `cl.exe` in the current path, and return `None` if this /// fails for any reason. fn vscmd_target_cl(env_getter: &dyn EnvGetter) -> Option<&'static str> { let cl_exe = env_getter.get_env("PATH").and_then(|path| {