Skip to content

Commit 246ece2

Browse files
authored
Merge pull request #163 from nomyfan/style/immutable
style: prefer immutable
2 parents c330321 + 7ceec77 commit 246ece2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -847,13 +847,11 @@ 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(|target| target.contains("msvc"))
854+
.unwrap_or(false);
857855

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

0 commit comments

Comments
 (0)