Add virtual runtime (FS only) #27
clippy
48 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 48 |
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
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
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
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
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
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
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
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 956 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:949:24
|
949 | let root_dir = Arc::new(RwLock::new(Inode {
| ________________________^
950 | | id: Some(id),
951 | | parent_link: None,
952 | | entry: InodeData::Dir(VirtDirInner {
... |
955 | | metadata: Metadata::empty_dir(Permissions {}, None),
956 | | }));
| |___________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 866 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:858:30
|
858 | new_entry.insert(Arc::new(RwLock::new(Inode {
| ______________________________^
859 | | id: Some(id),
860 | | parent_link: Some(ParentLink {
861 | | parent: parent_id,
... |
865 | | metadata,
866 | | })));
| |_______________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 848 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:841:24
|
841 | let root_dir = Arc::new(RwLock::new(Inode {
| ________________________^
842 | | id: Some(id),
843 | | parent_link: None,
844 | | entry: InodeData::Dir(VirtDirInner {
... |
847 | | metadata: Metadata::empty_dir(Permissions {}, None),
848 | | }));
| |___________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 699 in mfio-rt/src/virt/mod.rs
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 620 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:609:26
|
609 | new_entry.insert(Arc::new(RwLock::new(Inode {
| __________________________^
610 | | entry: InodeData::File(VirtFileInner {
611 | | data: from_file.data.clone(),
612 | | }),
... |
619 | | metadata: from.metadata.clone(),
620 | | })));
| |___________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 428 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:421:37
|
421 | ... .insert(Arc::new(RwLock::new(Inode {
| _______________________________^
422 | | ... id: Some(id),
423 | | ... parent_link: Some(ParentLink { parent, name }),
424 | | ... entry: InodeData::Dir(VirtDirInner {
... |
427 | | ... metadata: Metadata::empty_dir(Permissions {}, None),
428 | | ... })))
| |_________________________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 378 in mfio-rt/src/virt/mod.rs
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 364 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:354:26
|
354 | entry.insert(Arc::new(RwLock::new(Inode {
| __________________________^
355 | | id: Some(id),
356 | | metadata: Metadata::empty_dir(Permissions {}, None),
357 | | entry: InodeData::Dir(VirtDirInner {
... |
363 | | }),
364 | | })));
| |_______________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 348 in mfio-rt/src/virt/mod.rs
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 172 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:164:33
|
164 | .insert(Arc::new(RwLock::new(Inode {
| _________________________________^
165 | | id: Some(id),
166 | | parent_link: Some(ParentLink {
167 | | name: name.clone(),
... |
171 | | metadata: Metadata::empty_file(Permissions {}, None),
172 | | })))
| |___________________________^
|
= note: the trait `Sync` is not implemented for `RwLock<Inode>`
= note: required for `Arc<RwLock<Inode>>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
Check warning on line 108 in mfio-rt/src/virt/mod.rs
github-actions / clippy
usage of an `Arc` that is not `Send` or `Sync`
warning: usage of an `Arc` that is not `Send` or `Sync`
--> mfio-rt/src/virt/mod.rs:108:23
|
108 | Self::from_fs(Arc::new(VirtFs::default()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the trait `Send` is not implemented for `VirtFs`
= note: the trait `Sync` is not implemented for `VirtFs`
= note: required for `Arc<VirtFs>` to implement `Send` and `Sync`
= help: consider using an `Rc` instead or wrapping the inner type with a `Mutex`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
= note: `#[warn(clippy::arc_with_non_send_sync)]` on by default
Check warning on line 68 in mfio-rt/src/virt/mod.rs
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
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
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
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
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
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 764 in mfio-rt/src/test_suite.rs
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