Skip to content

Commit 8ba25dd

Browse files
Fix warnings generated by new clippy version.
1 parent 62c1709 commit 8ba25dd

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

src/cache/cache.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fn get_file_mode(file: &fs::File) -> Result<Option<u32>> {
4747
}
4848

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

6364
#[cfg(windows)]
65+
#[allow(clippy::unnecessary_wraps)]
6466
fn set_file_mode(_path: &Path, _mode: u32) -> Result<()> {
6567
Ok(())
6668
}

src/cache/gcs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ impl GCSCredentialProvider {
338338
}
339339
}
340340

341+
#[allow(clippy::unnecessary_wraps)]
341342
fn auth_request_jwt(
342343
&self,
343344
sa_key: &ServiceAccountKey,

src/commands.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ fn run_server_process() -> Result<ServerStartup> {
112112
}
113113

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

125126
#[cfg(windows)]
127+
#[allow(clippy::unnecessary_wraps)]
126128
fn redirect_stderr(f: File) -> Result<()> {
127129
use std::os::windows::io::IntoRawHandle;
128130
use winapi::um::processenv::SetStdHandle;

src/compiler/compiler.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ LLVM version: 6.0",
14531453
// wait on cache write future so we don't race with it!
14541454
f.wait().unwrap();
14551455
}
1456-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1456+
_ => panic!("Unexpected compile result: {:?}", cached),
14571457
}
14581458
assert_eq!(exit_status(0), res.status);
14591459
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
@@ -1554,7 +1554,7 @@ LLVM version: 6.0",
15541554
// wait on cache write future so we don't race with it!
15551555
f.wait().unwrap();
15561556
}
1557-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1557+
_ => panic!("Unexpected compile result: {:?}", cached),
15581558
}
15591559
assert_eq!(exit_status(0), res.status);
15601560
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
@@ -1662,7 +1662,7 @@ LLVM version: 6.0",
16621662
// wait on cache write future so we don't race with it!
16631663
f.wait().unwrap();
16641664
}
1665-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1665+
_ => panic!("Unexpected compile result: {:?}", cached),
16661666
}
16671667

16681668
assert_eq!(exit_status(0), res.status);
@@ -1744,7 +1744,7 @@ LLVM version: 6.0",
17441744
// wait on cache write future so we don't race with it!
17451745
f.wait().unwrap();
17461746
}
1747-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1747+
_ => panic!("Unexpected compile result: {:?}", cached),
17481748
}
17491749
assert_eq!(exit_status(0), res.status);
17501750
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
@@ -1771,7 +1771,7 @@ LLVM version: 6.0",
17711771
// wait on cache write future so we don't race with it!
17721772
f.wait().unwrap();
17731773
}
1774-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1774+
_ => panic!("Unexpected compile result: {:?}", cached),
17751775
}
17761776
assert_eq!(exit_status(0), res.status);
17771777
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());
@@ -1932,7 +1932,7 @@ LLVM version: 6.0",
19321932
// wait on cache write future so we don't race with it!
19331933
f.wait().unwrap();
19341934
}
1935-
_ => assert!(false, "Unexpected compile result: {:?}", cached),
1935+
_ => panic!("Unexpected compile result: {:?}", cached),
19361936
}
19371937
assert_eq!(exit_status(0), res.status);
19381938
assert_eq!(COMPILER_STDOUT, res.stdout.as_slice());

src/compiler/rust.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,6 +3063,7 @@ c:/foo/bar.rs:
30633063
.key
30643064
}
30653065

3066+
#[allow(clippy::unnecessary_wraps)]
30663067
fn nothing(_path: &Path) -> Result<()> {
30673068
Ok(())
30683069
}

0 commit comments

Comments
 (0)