Skip to content

base and child layers create indexed property collections

Sign in for the full log view
This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / clippy succeeded Sep 19, 2023 in 1s

clippy

74 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 74
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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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 1210 in src/storage/archive.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
    --> src/storage/archive.rs:1210:40
     |
1210 |         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 1209 in src/storage/archive.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `skip(..).next()` on an iterator

warning: called `skip(..).next()` on an iterator
    --> src/storage/archive.rs:1209:41
     |
1209 |         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 1048 in src/storage/archive.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant pattern matching, consider using `is_pending()`

warning: redundant pattern matching, consider using `is_pending()`
    --> src/storage/archive.rs:1048:16
     |
1048 |         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 674 in src/storage/archive.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

if let .. else expression looks like `matches!` macro

warning: if let .. else expression looks like `matches!` macro
   --> src/storage/archive.rs:670:9
    |
670 | /         if let ConstructionFileState::Finalized(_) = &*guard {
671 | |             true
672 | |         } else {
673 | |             false
674 | |         }
    | |_________^ 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

See this annotation in the file changed.

@github-actions 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

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
   --> 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

See this annotation in the file changed.

@github-actions 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 2048 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:2048:50
     |
2048 |         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 2047 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:2047:51
     |
2047 |         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 2006 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:2006:32
     |
2006 |             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 2005 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:2005:33
     |
2005 |             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 2004 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:2004:32
     |
2004 |             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 1605 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:1603:25
     |
1603 | /                         ChildLayer::load_from_files(rollup_id, ancestor, &files)
1604 | |                             .await?
1605 | |                             .into(),
     | |___________________________________^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
help: consider removing `.into()`
     |
1603 ~                         ChildLayer::load_from_files(rollup_id, ancestor, &files)
1604 ~                             .await?,
     |

Check warning on line 1595 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:1595:38
     |
1595 |                     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 1567 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:34
     |
1567 |                         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 1562 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions 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:1562:38
     |
1562 |                     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 1534 in src/storage/layer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

warning: unneeded late initialization
    --> src/storage/layer.rs:1534:25
     |
1534 |                         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
     |
1535 |                         let original_parent = if self.layer_has_parent(current_layer).await? {
     |                         +++++++++++++++++++++
help: remove the assignments from the branches
     |
1536 ~                             Some(self.read_parent_file(current_layer).await?)
1537 |                         } else {
1538 ~                             None
     |
help: add a semicolon after the `if` expression
     |
1539 |                         };
     |                          +