diff options
author | Florian Klink <flokli@flokli.de> | 2023-08-19T15·16+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2023-08-20T21·51+0000 |
commit | 3ffbcc6c8a9bca119248d4ffe00c24a903979e1a (patch) | |
tree | a97ffb415169c5a6affe60c4cd1bddcbc787c40f /tvix/store/src/fuse | |
parent | bc852fa56f3ac4ea1d506a0296c27ecb91a7589d (diff) |
refactor(tvix/store): cargo clippy r/6500
Change-Id: I3a80560d036e7ed08036b5e9f0974080d1a30ded Reviewed-on: https://cl.tvl.fyi/c/depot/+/9096 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/store/src/fuse')
-rw-r--r-- | tvix/store/src/fuse/inode_tracker.rs | 12 | ||||
-rw-r--r-- | tvix/store/src/fuse/tests.rs | 17 |
2 files changed, 14 insertions, 15 deletions
diff --git a/tvix/store/src/fuse/inode_tracker.rs b/tvix/store/src/fuse/inode_tracker.rs index 67d9d9b9bf46..97a9744c31d7 100644 --- a/tvix/store/src/fuse/inode_tracker.rs +++ b/tvix/store/src/fuse/inode_tracker.rs @@ -283,7 +283,7 @@ mod tests { let dir: InodeData = fixtures::DIRECTORY_WITH_KEEP.clone().into(); // put it in - let dir_ino = inode_tracker.put(dir.clone()); + let dir_ino = inode_tracker.put(dir); // a get should return the right data let data = inode_tracker.get(dir_ino).expect("must be some"); @@ -316,7 +316,7 @@ mod tests { InodeData::Regular(ref digest, size, executable) => { assert_eq!(&fixtures::EMPTY_BLOB_DIGEST.clone(), digest); assert_eq!(0, size); - assert_eq!(false, executable); + assert!(!executable); } InodeData::Symlink(_) | InodeData::Directory(..) => panic!("wrong type"), } @@ -335,7 +335,7 @@ mod tests { let dir_complicated: InodeData = fixtures::DIRECTORY_COMPLICATED.clone().into(); // put it in - let dir_complicated_ino = inode_tracker.put(dir_complicated.clone()); + let dir_complicated_ino = inode_tracker.put(dir_complicated); // a get should return the right data let dir_data = inode_tracker @@ -360,7 +360,7 @@ mod tests { // check the first child (.keep) { let (child_ino, child_node) = &children[0]; - assert!(!seen_inodes.contains(&child_ino)); + assert!(!seen_inodes.contains(child_ino)); assert_eq!( &proto::node::Node::File(fixtures::DIRECTORY_COMPLICATED.files[0].clone()), child_node @@ -371,7 +371,7 @@ mod tests { // check the second child (aa) { let (child_ino, child_node) = &children[1]; - assert!(!seen_inodes.contains(&child_ino)); + assert!(!seen_inodes.contains(child_ino)); assert_eq!( &proto::node::Node::Symlink( fixtures::DIRECTORY_COMPLICATED.symlinks[0].clone() @@ -384,7 +384,7 @@ mod tests { // check the third child (keep) { let (child_ino, child_node) = &children[2]; - assert!(!seen_inodes.contains(&child_ino)); + assert!(!seen_inodes.contains(child_ino)); assert_eq!( &proto::node::Node::Directory( fixtures::DIRECTORY_COMPLICATED.directories[0].clone() diff --git a/tvix/store/src/fuse/tests.rs b/tvix/store/src/fuse/tests.rs index 7d01902c6848..e5e36579b6c2 100644 --- a/tvix/store/src/fuse/tests.rs +++ b/tvix/store/src/fuse/tests.rs @@ -444,7 +444,7 @@ fn read_stat_directory() { let p = tmpdir.path().join(DIRECTORY_WITH_KEEP_NAME); // peek at the metadata of the directory - let metadata = fs::metadata(&p).expect("must succeed"); + let metadata = fs::metadata(p).expect("must succeed"); assert!(metadata.is_dir()); assert!(metadata.permissions().readonly()); @@ -667,8 +667,8 @@ fn compare_inodes_directories() { // peek at metadata. assert_eq!( - fs::metadata(&p_dir_with_keep).expect("must succeed").ino(), - fs::metadata(&p_sibling_dir).expect("must succeed").ino() + fs::metadata(p_dir_with_keep).expect("must succeed").ino(), + fs::metadata(p_sibling_dir).expect("must succeed").ino() ); fuser_session.join() @@ -697,8 +697,8 @@ fn compare_inodes_files() { // peek at metadata. assert_eq!( - fs::metadata(&p_keep1).expect("must succeed").ino(), - fs::metadata(&p_keep2).expect("must succeed").ino() + fs::metadata(p_keep1).expect("must succeed").ino(), + fs::metadata(p_keep2).expect("must succeed").ino() ); fuser_session.join() @@ -726,8 +726,8 @@ fn compare_inodes_symlinks() { // peek at metadata. assert_eq!( - fs::symlink_metadata(&p1).expect("must succeed").ino(), - fs::symlink_metadata(&p2).expect("must succeed").ino() + fs::symlink_metadata(p1).expect("must succeed").ino(), + fs::symlink_metadata(p2).expect("must succeed").ino() ); fuser_session.join() @@ -786,7 +786,7 @@ fn disallow_writes() { let fuser_session = setup_and_mount(tmpdir.path(), |_, _, _| {}).expect("must succeed"); let p = tmpdir.path().join(BLOB_A_NAME); - let e = std::fs::File::create(&p).expect_err("must fail"); + let e = std::fs::File::create(p).expect_err("must fail"); assert_eq!(std::io::ErrorKind::Unsupported, e.kind()); @@ -815,7 +815,6 @@ fn missing_directory() { // It fails when trying to pull the first entry, because we don't implement opendir separately fs::read_dir(&p) .unwrap() - .into_iter() .next() .expect("must be some") .expect_err("must be err"); |