Skip to content

Commit f6f6413

Browse files
committed
Clippy
1 parent b5b0074 commit f6f6413

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/windows/find_tools.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum TargetArch {
3838
Arm64ec,
3939
}
4040
impl TargetArch {
41-
/// Parse the TargetArch from a str. Returns `None` if the arch is unrecognized.
41+
/// Parse the `TargetArch` from a str. Returns `None` if the arch is unrecognized.
4242
fn new(arch: &str) -> Option<Self> {
4343
match arch {
4444
"x64" | "x86_64" => Some(Self::X64),
@@ -155,9 +155,7 @@ pub(crate) fn find_tool_inner(
155155
env_getter: &dyn EnvGetter,
156156
) -> Option<Tool> {
157157
// We only need the arch.
158-
let Some(target) = TargetArch::new(full_arch) else {
159-
return None;
160-
};
158+
let target = TargetArch::new(full_arch)?;
161159

162160
// Looks like msbuild isn't located in the same location as other tools like
163161
// cl.exe and lib.exe.
@@ -298,7 +296,7 @@ mod impl_ {
298296
/// # SAFETY
299297
///
300298
/// The caller must ensure that the function signature matches the actual function.
301-
/// The easiest way to do this is to add an entry to windows_sys_no_link.list and use the
299+
/// The easiest way to do this is to add an entry to `windows_sys_no_link.list` and use the
302300
/// generated function for `func_signature`.
303301
///
304302
/// The function returned cannot be used after the handle is dropped.
@@ -394,7 +392,7 @@ mod impl_ {
394392
Some(target.as_vs_arch() == cmd_target)
395393
}
396394

397-
/// Detect the target architecture of `cl.exe`` in the current path, and return `None` if this
395+
/// Detect the target architecture of `cl.exe` in the current path, and return `None` if this
398396
/// fails for any reason.
399397
fn vscmd_target_cl(env_getter: &dyn EnvGetter) -> Option<&'static str> {
400398
let cl_exe = env_getter.get_env("PATH").and_then(|path| {

0 commit comments

Comments
 (0)