Skip to content

Commit

Permalink
Fix warnings generated by new clippy version.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Mar 2, 2021
1 parent 62c1709 commit 8ba25dd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/cache/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ fn get_file_mode(file: &fs::File) -> Result<Option<u32>> {
}

#[cfg(windows)]
#[allow(clippy::unnecessary_wraps)]
fn get_file_mode(_file: &fs::File) -> Result<Option<u32>> {
Ok(None)
}
Expand All @@ -61,6 +62,7 @@ fn set_file_mode(path: &Path, mode: u32) -> Result<()> {
}

#[cfg(windows)]
#[allow(clippy::unnecessary_wraps)]
fn set_file_mode(_path: &Path, _mode: u32) -> Result<()> {
Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions src/cache/gcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ impl GCSCredentialProvider {
}
}

#[allow(clippy::unnecessary_wraps)]
fn auth_request_jwt(
&self,
sa_key: &ServiceAccountKey,
Expand Down
2 changes: 2 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fn run_server_process() -> Result<ServerStartup> {
}

#[cfg(not(windows))]
#[allow(clippy::unnecessary_wraps)]
fn redirect_stderr(f: File) -> Result<()> {
use libc::dup2;
use std::os::unix::io::IntoRawFd;
Expand All @@ -123,6 +124,7 @@ fn redirect_stderr(f: File) -> Result<()> {
}

#[cfg(windows)]
#[allow(clippy::unnecessary_wraps)]
fn redirect_stderr(f: File) -> Result<()> {
use std::os::windows::io::IntoRawHandle;
use winapi::um::processenv::SetStdHandle;
Expand Down
12 changes: 6 additions & 6 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}
assert_eq!(exit_status(0), res.status);
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
Expand Down Expand Up @@ -1554,7 +1554,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}
assert_eq!(exit_status(0), res.status);
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
Expand Down Expand Up @@ -1662,7 +1662,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}

assert_eq!(exit_status(0), res.status);
Expand Down Expand Up @@ -1744,7 +1744,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}
assert_eq!(exit_status(0), res.status);
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
Expand All @@ -1771,7 +1771,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}
assert_eq!(exit_status(0), res.status);
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
Expand Down Expand Up @@ -1932,7 +1932,7 @@ LLVM version: 6.0",
// wait on cache write future so we don't race with it!
f.wait().unwrap();
}
_ => assert!(false, "Unexpected compile result: {:?}", cached),
_ => panic!("Unexpected compile result: {:?}", cached),
}
assert_eq!(exit_status(0), res.status);
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
Expand Down
1 change: 1 addition & 0 deletions src/compiler/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3063,6 +3063,7 @@ c:/foo/bar.rs:
.key
}

#[allow(clippy::unnecessary_wraps)]
fn nothing(_path: &Path) -> Result<()> {
Ok(())
}
Expand Down

0 comments on commit 8ba25dd

Please sign in to comment.