indexed property iterator #595
clippy
70 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 70 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.72.0 (5680fa18f 2023-08-23)
- cargo 1.72.0 (103a7ff2e 2023-08-15)
- clippy 0.1.72 (5680fa1 2023-08-23)
Annotations
Check warning on line 171 in src/storage/pack.rs
github-actions / clippy
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> src/storage/pack.rs:171:17
|
171 | layer_path: &PathBuf,
| ^^^^^^^^ help: change this to: `&Path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 141 in src/storage/pack.rs
github-actions / clippy
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
warning: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> src/storage/pack.rs:141:17
|
141 | layer_path: &PathBuf,
| ^^^^^^^^ help: change this to: `&Path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
Check warning on line 33 in src/storage/memory.rs
github-actions / clippy
you should consider adding a `Default` implementation for `MemoryBackedStore`
warning: you should consider adding a `Default` implementation for `MemoryBackedStore`
--> src/storage/memory.rs:29:5
|
29 | / pub fn new() -> Self {
30 | | Self {
31 | | contents: Arc::new(RwLock::new(MemoryBackedStoreContents::Nonexistent)),
32 | | }
33 | | }
| |_____^
|
= 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
|
28 + impl Default for MemoryBackedStore {
29 + fn default() -> Self {
30 + Self::new()
31 + }
32 + }
|
Check warning on line 22 in src/storage/delta.rs
github-actions / clippy
deref on an immutable reference
warning: deref on an immutable reference
--> src/storage/delta.rs:22:17
|
22 | let mut l = &*layer;
| ^^^^^^^ help: if you would like to reborrow, try removing `&*`: `layer`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
= note: `#[warn(clippy::borrow_deref_ref)]` on by default
Check warning on line 1189 in src/storage/archive.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
--> src/storage/archive.rs:1189:40
|
1189 | let rollup_id = string_to_name(&line)?;
| ^^^^^ help: change this to: `line`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 1188 in src/storage/archive.rs
github-actions / clippy
called `skip(..).next()` on an iterator
warning: called `skip(..).next()` on an iterator
--> src/storage/archive.rs:1188:41
|
1188 | let line = rollup_string.lines().skip(1).next().unwrap();
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
Check warning on line 1027 in src/storage/archive.rs
github-actions / clippy
redundant pattern matching, consider using `is_pending()`
warning: redundant pattern matching, consider using `is_pending()`
--> src/storage/archive.rs:1027:16
|
1027 | if let Poll::Pending = read {
| -------^^^^^^^^^^^^^------- help: try this: `if read.is_pending()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
= note: `#[warn(clippy::redundant_pattern_matching)]` on by default
Check warning on line 675 in src/storage/archive.rs
github-actions / clippy
if let .. else expression looks like `matches!` macro
warning: if let .. else expression looks like `matches!` macro
--> src/storage/archive.rs:671:9
|
671 | / if let ConstructionFileState::Finalized(_) = &*guard {
672 | | true
673 | | } else {
674 | | false
675 | | }
| |_________^ help: try this: `matches!(&*guard, ConstructionFileState::Finalized(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Check warning on line 516 in src/storage/archive.rs
github-actions / clippy
deref which would be done by auto-deref
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:516:41
|
516 | drop_from_cache(&mut *cache, id);
| ^^^^^^^^^^^ help: try this: `&mut cache`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
Check warning on line 511 in src/storage/archive.rs
github-actions / clippy
deref which would be done by auto-deref
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:511:45
|
511 | ... drop_from_cache(&mut *cache, id);
| ^^^^^^^^^^^ help: try this: `&mut cache`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
Check warning on line 500 in src/storage/archive.rs
github-actions / clippy
deref which would be done by auto-deref
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:500:29
|
500 | ... &mut *cache,
| ^^^^^^^^^^^ help: try this: `&mut cache`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
= note: `#[warn(clippy::explicit_auto_deref)]` on by default
Check warning on line 416 in src/storage/archive.rs
github-actions / clippy
using `clone` on type `[u32; 5]` which implements the `Copy` trait
warning: using `clone` on type `[u32; 5]` which implements the `Copy` trait
--> src/storage/archive.rs:416:22
|
416 | let id = peek.0.clone();
| ^^^^^^^^^^^^^^ help: try dereferencing it: `*peek.0`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 376 in src/storage/archive.rs
github-actions / clippy
if let .. else expression looks like `matches!` macro
warning: if let .. else expression looks like `matches!` macro
--> src/storage/archive.rs:372:9
|
372 | / if let Self::Resolving(_) = self {
373 | | true
374 | | } else {
375 | | false
376 | | }
| |_________^ help: try this: `matches!(self, Self::Resolving(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
Check warning on line 321 in src/storage/archive.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
--> src/storage/archive.rs:321:32
|
321 | Ok(Some(string_to_name(&name)?))
| ^^^^^ help: change this to: `name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 318 in src/storage/archive.rs
github-actions / clippy
called `skip(..).next()` on an iterator
warning: called `skip(..).next()` on an iterator
--> src/storage/archive.rs:318:32
|
318 | let name = data.lines().skip(1).next().expect(
| ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
= note: `#[warn(clippy::iter_skip_next)]` on by default
Check warning on line 2012 in src/storage/layer.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/storage/layer.rs:2012:50
|
2012 | let mut predicate_existences = bitvec![0;stack_pred_count as usize+1];
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stack_pred_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 2011 in src/storage/layer.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/storage/layer.rs:2011:51
|
2011 | let mut node_value_existences = bitvec![0;stack_node_value_count as usize+1];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `stack_node_value_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 1970 in src/storage/layer.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/storage/layer.rs:1970:32
|
1970 | base_pred_count += self.get_predicate_count(current).await?.unwrap_or(0) as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.get_predicate_count(current).await?.unwrap_or(0)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 1969 in src/storage/layer.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/storage/layer.rs:1969:33
|
1969 | base_value_count += self.get_value_count(current).await?.unwrap_or(0) as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.get_value_count(current).await?.unwrap_or(0)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 1968 in src/storage/layer.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/storage/layer.rs:1968:32
|
1968 | base_node_count += self.get_node_count(current).await?.unwrap_or(0) as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.get_node_count(current).await?.unwrap_or(0)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 1569 in src/storage/layer.rs
github-actions / clippy
useless conversion to the same type: `layer::internal::InternalLayer`
warning: useless conversion to the same type: `layer::internal::InternalLayer`
--> src/storage/layer.rs:1567:25
|
1567 | / ChildLayer::load_from_files(rollup_id, ancestor, &files)
1568 | | .await?
1569 | | .into(),
| |___________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
help: consider removing `.into()`
|
1567 ~ ChildLayer::load_from_files(rollup_id, ancestor, &files)
1568 ~ .await?,
|
Check warning on line 1559 in src/storage/layer.rs
github-actions / clippy
useless conversion to the same type: `layer::internal::InternalLayer`
warning: useless conversion to the same type: `layer::internal::InternalLayer`
--> src/storage/layer.rs:1559:38
|
1559 | layer = Arc::new(child_layer.into());
| ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `child_layer`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 1531 in src/storage/layer.rs
github-actions / clippy
useless conversion to the same type: `layer::internal::InternalLayer`
warning: useless conversion to the same type: `layer::internal::InternalLayer`
--> src/storage/layer.rs:1531:34
|
1531 | Arc::new(BaseLayer::load_from_files(rollup_id, &files).await?.into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `BaseLayer::load_from_files(rollup_id, &files).await?`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Check warning on line 1526 in src/storage/layer.rs
github-actions / clippy
useless conversion to the same type: `layer::internal::InternalLayer`
warning: useless conversion to the same type: `layer::internal::InternalLayer`
--> src/storage/layer.rs:1526:38
|
1526 | layer = Arc::new(base_layer.into());
| ^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `base_layer`
|
= 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 1498 in src/storage/layer.rs
github-actions / clippy
unneeded late initialization
warning: unneeded late initialization
--> src/storage/layer.rs:1498:25
|
1498 | let original_parent;
| ^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
= note: `#[warn(clippy::needless_late_init)]` on by default
help: declare `original_parent` here
|
1499 | let original_parent = if self.layer_has_parent(current_layer).await? {
| +++++++++++++++++++++
help: remove the assignments from the branches
|
1500 ~ Some(self.read_parent_file(current_layer).await?)
1501 | } else {
1502 ~ None
|
help: add a semicolon after the `if` expression
|
1503 | };
| +