Skip to content

Commit d0256ec

Browse files
committed
style: prefer immutable
1 parent c330321 commit d0256ec

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,13 +847,10 @@ impl Library {
847847
}
848848

849849
fn parse_libs_cflags(&mut self, name: &str, output: &[u8], config: &Config) {
850-
let mut is_msvc = false;
851850
let target = env::var("TARGET");
852-
if let Ok(target) = &target {
853-
if target.contains("msvc") {
854-
is_msvc = true;
855-
}
856-
}
851+
let is_msvc = target
852+
.as_ref()
853+
.map_or(false, |target| target.contains("msvc"));
857854

858855
let system_roots = if cfg!(target_os = "macos") {
859856
vec![PathBuf::from("/Library"), PathBuf::from("/System")]

0 commit comments

Comments
 (0)