Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kpcyrd committed Oct 11, 2023
1 parent c49b5b3 commit 651b995
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tools/src/pager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::process::{Command, Stdio};
pub fn write(buf: &[u8]) -> Result<()> {
if atty::is(atty::Stream::Stdout) && env::var_os("NOPAGER").is_none() {
let mut cmd = Command::new("less")
.args(&["-R"])
.args(["-R"])
.stdin(Stdio::piped())
.spawn()
.context("Failed to spawn pager")?;
Expand Down
8 changes: 4 additions & 4 deletions worker/src/rebuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ mod tests {
#[tokio::test]
async fn compare_large_files_equal() {
let dir = tempfile::tempdir().unwrap();
fs::write(dir.path().join("a"), &[0u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("b"), &[0u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("a"), [0u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("b"), [0u8; 4096 * 100]).unwrap();
let equal = compare_files(&dir.path().join("a"), &dir.path().join("b")).await.unwrap();
assert!(equal);
}

#[tokio::test]
async fn compare_large_files_not_equal() {
let dir = tempfile::tempdir().unwrap();
fs::write(dir.path().join("a"), &[0u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("b"), &[1u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("a"), [0u8; 4096 * 100]).unwrap();
fs::write(dir.path().join("b"), [1u8; 4096 * 100]).unwrap();
let equal = compare_files(&dir.path().join("a"), &dir.path().join("b")).await.unwrap();
assert!(!equal);
}
Expand Down

0 comments on commit 651b995

Please sign in to comment.