Skip to content

Add virtual runtime (FS only) #27

Add virtual runtime (FS only)

Add virtual runtime (FS only) #27

GitHub Actions / clippy succeeded Nov 11, 2023

clippy

34 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 34
Note 0
Help 0

Versions

  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • clippy 0.1.73 (cc66ad46 2023-10-03)

Annotations

Check warning on line 764 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:764:34
    |
764 |         seq(run.writes_equal_rel(&tdir)).await;
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 759 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:759:30
    |
759 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 737 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:737:38
    |
737 |             seq(run.writes_equal_rel(&tdir2)),
    |                                      ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 736 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:736:34
    |
736 |             seq(run.writes_equal(&tdir)),
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 725 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:725:34
    |
725 |         seq(run.writes_equal_rel(&tdir2)).await;
    |                                  ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 724 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:724:30
    |
724 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 1064 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
    --> mfio-rt/src/virt/mod.rs:1064:9
     |
1064 |         while let Some(component) = components.next() {
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for component in components`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

Check warning on line 699 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`

warning: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
   --> mfio-rt/src/virt/mod.rs:689:19
    |
689 |           let ret = inode
    |  ___________________^
690 | |             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 | |             // difference here is that we are doing so with read-only lock.
692 | |             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
...   |
698 | |                 })
699 | |             });
    | |______________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
    = note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: try
    |
689 ~         let ret = inode
690 +             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 +             // difference here is that we are doing so with read-only lock.
692 +             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
693 +             .ok_or(mferr!(Directory, NotFound, Filesystem)).map(|inode| VirtDir {
694 +                     inode,
695 +                     fs: self.fs.clone(),
696 ~                 });
    |

Check warning on line 378 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
   --> mfio-rt/src/virt/mod.rs:378:9
    |
378 |         while let Some(component) = components.next() {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for component in components`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
    = note: `#[warn(clippy::while_let_on_iterator)]` on by default

Check warning on line 348 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> mfio-rt/src/virt/mod.rs:348:13
    |
348 |             return Err(mferr!(Directory, AlreadyExists, Filesystem));
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
348 -             return Err(mferr!(Directory, AlreadyExists, Filesystem));
348 +             Err(mferr!(Directory, AlreadyExists, Filesystem))
    |

Check warning on line 68 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `VirtRt`

warning: you should consider adding a `Default` implementation for `VirtRt`
  --> mfio-rt/src/virt/mod.rs:63:5
   |
63 | /     pub fn new() -> Self {
64 | |         Self {
65 | |             cwd: VirtDir::default(),
66 | |             backend: BackendContainer::new_dyn(pending()),
67 | |         }
68 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
62 + impl Default for VirtRt {
63 +     fn default() -> Self {
64 +         Self::new()
65 +     }
66 + }
   |

Check warning on line 44 in mfio-rt/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant guard

warning: redundant guard
  --> mfio-rt/src/util.rs:44:39
   |
44 |                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
help: try
   |
44 -                 (Some(_), Some(b)) if b == Component::ParentDir => return None,
44 +                 (Some(_), Some(Component::ParentDir)) => return None,
   |

Check warning on line 43 in mfio-rt/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant guard

warning: redundant guard
  --> mfio-rt/src/util.rs:43:39
   |
43 |                 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
   |                                       ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
   = note: `#[warn(clippy::redundant_guards)]` on by default
help: try
   |
43 -                 (Some(a), Some(b)) if b == Component::CurDir => comps.push(a),
43 +                 (Some(a), Some(Component::CurDir)) => comps.push(a),
   |

Check warning on line 128 in mfio-rt/src/util.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `null` is never used

warning: associated function `null` is never used
   --> mfio-rt/src/util.rs:128:12
    |
127 | impl RawBox {
    | ----------- associated function in this implementation
128 |     pub fn null() -> Self {
    |            ^^^^

Check warning on line 19 in mfio-rt/src/native/impls/unix_extra.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `new_socket` is never used

warning: function `new_socket` is never used
  --> mfio-rt/src/native/impls/unix_extra.rs:19:15
   |
19 | pub(crate) fn new_socket(
   |               ^^^^^^^^^^

Check warning on line 7 in mfio-rt/src/native/impls/unix_extra.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

function `new_for_addr` is never used

warning: function `new_for_addr` is never used
 --> mfio-rt/src/native/impls/unix_extra.rs:7:15
  |
7 | pub(crate) fn new_for_addr(
  |               ^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

Check warning on line 1064 in mfio/src/io/packet/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `io::packet::FullPacket<T, Perms>`

warning: useless conversion to the same type: `io::packet::FullPacket<T, Perms>`
    --> mfio/src/io/packet/mod.rs:1064:9
     |
1064 |         self.into()
     |         ^^^^^^^^^^^ help: consider removing `.into()`: `self`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
     = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 764 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:764:34
    |
764 |         seq(run.writes_equal_rel(&tdir)).await;
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 759 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:759:30
    |
759 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 737 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:737:38
    |
737 |             seq(run.writes_equal_rel(&tdir2)),
    |                                      ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 736 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:736:34
    |
736 |             seq(run.writes_equal(&tdir)),
    |                                  ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 725 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:725:34
    |
725 |         seq(run.writes_equal_rel(&tdir2)).await;
    |                                  ^^^^^^ help: change this to: `tdir2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 724 in mfio-rt/src/test_suite.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> mfio-rt/src/test_suite.rs:724:30
    |
724 |         seq(run.writes_equal(&tdir)).await;
    |                              ^^^^^ help: change this to: `tdir`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Check warning on line 1064 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this loop could be written as a `for` loop

warning: this loop could be written as a `for` loop
    --> mfio-rt/src/virt/mod.rs:1064:9
     |
1064 |         while let Some(component) = components.next() {
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for component in components`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator

Check warning on line 699 in mfio-rt/src/virt/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`

warning: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
   --> mfio-rt/src/virt/mod.rs:689:19
    |
689 |           let ret = inode
    |  ___________________^
690 | |             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 | |             // difference here is that we are doing so with read-only lock.
692 | |             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
...   |
698 | |                 })
699 | |             });
    | |______________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map
    = note: `#[warn(clippy::bind_instead_of_map)]` on by default
help: try
    |
689 ~         let ret = inode
690 +             // TODO: do we want to filter here, since we are returning None later anyways. The only
691 +             // difference here is that we are doing so with read-only lock.
692 +             .filter(|dir| matches!(dir.read().entry, InodeData::Dir(_)))
693 +             .ok_or(mferr!(Directory, NotFound, Filesystem)).map(|inode| VirtDir {
694 +                     inode,
695 +                     fs: self.fs.clone(),
696 ~                 });
    |