Skip to content

Commit

Permalink
fmt and clippy fixes
Browse files Browse the repository at this point in the history
Fixes from rustmt and clippy
  • Loading branch information
harryt@coretechsec authored and sylvestre committed May 30, 2023
1 parent 78b8455 commit 0ae6bf5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/compiler/gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ where
let mut xclangs: Vec<OsString> = vec![];
let mut color_mode = ColorMode::Auto;
let mut seen_arch = None;
let dont_cache_multiarch = !env::var("SCCACHE_CACHE_MULTIARCH").is_ok();
let dont_cache_multiarch = env::var("SCCACHE_CACHE_MULTIARCH").is_err();

// Custom iterator to expand `@` arguments which stand for reading a file
// and interpreting it as a list of more arguments.
Expand Down Expand Up @@ -371,7 +371,9 @@ where
Some(Arch(arch)) => {
match seen_arch {
Some(s) if &s != arch && dont_cache_multiarch => {
cannot_cache!("multiple different -arch, and SCCACHE_CACHE_MULTIARCH not set")
cannot_cache!(
"multiple different -arch, and SCCACHE_CACHE_MULTIARCH not set"
)
}
_ => {}
};
Expand Down Expand Up @@ -661,7 +663,7 @@ fn preprocess_cmd<T>(
.map(|arg_string| format!("-D__{}__=1", arg_string).into())
})
.collect::<Vec<OsString>>();

let mut arch_args_to_use = &rewritten_arch_args;
let mut unique_rewritten = rewritten_arch_args.clone();
unique_rewritten.sort();
Expand Down Expand Up @@ -1766,7 +1768,6 @@ mod test {
}

with_var("SCCACHE_CACHE_MULTIARCH", Some("1"), || {

match parse_arguments_(
stringvec!["-arch", "arm64", "-arch", "arm64", "-o", "foo.o", "-c", "foo.cpp"],
false,
Expand All @@ -1775,8 +1776,9 @@ mod test {
o => panic!("Got unexpected parse result: {:?}", o),
}

let args =
stringvec!["-fPIC", "-arch", "arm64", "-arch", "i386", "-o", "foo.o", "-c", "foo.cpp"];
let args = stringvec![
"-fPIC", "-arch", "arm64", "-arch", "i386", "-o", "foo.o", "-c", "foo.cpp"
];
let ParsedArguments {
input,
language,
Expand Down

0 comments on commit 0ae6bf5

Please sign in to comment.