removed unnecessary lifetimes #589
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
6 errors and 141 warnings
clippy
Clippy had exited with the 101 exit code
|
build-and-test (ubuntu-latest, bash)
Process completed with exit code 1.
|
build-and-test (windows-latest, msys2)
The job was canceled because "ubuntu-latest_bash" failed.
|
build-and-test (windows-latest, msys2)
The operation was canceled.
|
build-and-test (macos-latest, bash)
The job was canceled because "ubuntu-latest_bash" failed.
|
build-and-test (macos-latest, bash)
The operation was canceled.
|
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do:
src/storage/pack.rs#L171
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
|
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do:
src/storage/pack.rs#L141
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
|
you should consider adding a `Default` implementation for `MemoryBackedStore`:
src/storage/memory.rs#L29
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 + }
|
|
deref on an immutable reference:
src/storage/delta.rs#L22
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/archive.rs#L1189
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
|
called `skip(..).next()` on an iterator:
src/storage/archive.rs#L1188
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
|
redundant pattern matching, consider using `is_pending()`:
src/storage/archive.rs#L1027
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
|
if let .. else expression looks like `matches!` macro:
src/storage/archive.rs#L671
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L516
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L511
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L500
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
|
using `clone` on type `[u32; 5]` which implements the `Copy` trait:
src/storage/archive.rs#L416
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
|
if let .. else expression looks like `matches!` macro:
src/storage/archive.rs#L372
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/archive.rs#L321
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
|
called `skip(..).next()` on an iterator:
src/storage/archive.rs#L318
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
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/storage/layer.rs#L2012
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
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/storage/layer.rs#L2011
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1970
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1969
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1968
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1567
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?,
|
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1559
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1531
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1526
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
|
unneeded late initialization:
src/storage/layer.rs#L1498
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 | };
| +
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/storage/file.rs#L446
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/storage/file.rs:446:1
|
446 | impl Into<AdjacencyList> for AdjacencyListMaps {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<storage::file::AdjacencyListMaps>`
|
446 ~ impl From<AdjacencyListMaps> for AdjacencyList {
447 ~ fn from(val: AdjacencyListMaps) -> Self {
448 | AdjacencyList::parse(
449 ~ val.nums_map,
450 ~ val.bitindex_maps.bits_map,
451 ~ val.bitindex_maps.blocks_map,
452 ~ val.bitindex_maps.sblocks_map,
|
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/storage/file.rs#L405
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/storage/file.rs:405:1
|
405 | impl Into<BitIndex> for BitIndexMaps {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<storage::file::BitIndexMaps>`
|
405 ~ impl From<BitIndexMaps> for BitIndex {
406 ~ fn from(val: BitIndexMaps) -> Self {
407 ~ BitIndex::from_maps(val.bits_map, val.blocks_map, val.sblocks_map)
|
|
this call to `from_str_radix` can be replaced with a call to `str::parse`:
src/storage/directory.rs#L229
warning: this call to `from_str_radix` can be replaced with a call to `str::parse`
--> src/storage/directory.rs:229:19
|
229 | let version = u64::from_str_radix(version_str, 10);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `version_str.parse::<u64>()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
= note: `#[warn(clippy::from_str_radix_10)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/directory.rs#L214
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/storage/directory.rs:214:37
|
214 | let s = String::from_utf8_lossy(&data);
| ^^^^^ help: change this to: `data`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
module has the same name as its containing module:
src/logging/mod.rs#L7
warning: module has the same name as its containing module
--> src/logging/mod.rs:7:1
|
7 | pub mod logging;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
|
`if` chain can be rewritten with `match`:
src/layer/simple_builder.rs#L272
warning: `if` chain can be rewritten with `match`
--> src/layer/simple_builder.rs:272:13
|
272 | / if addition < removal {
273 | | additions_it.next();
274 | | } else if addition > removal {
275 | | let removal = removals_it.next().unwrap();
... |
288 | | *removal = IdTriple::new(0, 0, 0);
289 | | }
| |_____________^
|
= help: consider rewriting the `if` chain to use `cmp` and `match`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
= note: `#[warn(clippy::comparison_chain)]` on by default
|
mutable key type:
src/layer/layer.rs#L309
warning: mutable key type
--> src/layer/layer.rs:309:20
|
309 | value_map: &HashMap<TypedDictEntry, u64>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type
= note: `#[warn(clippy::mutable_key_type)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L273
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:273:65
|
273 | Self::Unresolved(u) => PossiblyResolved::Unresolved(&u),
| ^^ help: change this to: `u`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L134
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:134:38
|
134 | .object_value_id(&value)
| ^^^^^^ help: change this to: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L130
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:130:37
|
130 | .object_node_id(&node)
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L102
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:102:70
|
102 | ObjectType::Value(value) => self.object_value_id(&value),
| ^^^^^^ help: change this to: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L101
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:101:67
|
101 | ObjectType::Node(node) => self.object_node_id(&node),
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
module has the same name as its containing module:
src/layer/mod.rs#L9
warning: module has the same name as its containing module
--> src/layer/mod.rs:9:1
|
9 | mod layer;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/layer/internal/mod.rs#L670
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/layer/internal/mod.rs:670:35
|
670 | if corrected_id > parent_count as u64 {
| ^^^^^^^^^^^^^^^^^^^ help: try: `parent_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/layer/internal/mod.rs#L639
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/layer/internal/mod.rs:639:35
|
639 | if corrected_id > parent_count as u64 {
| ^^^^^^^^^^^^^^^^^^^ help: try: `parent_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
match expression looks like `matches!` macro:
src/layer/internal/mod.rs#L528
warning: match expression looks like `matches!` macro
--> src/layer/internal/mod.rs:528:9
|
528 | / match self {
529 | | Rollup(_) => true,
530 | | _ => false,
531 | | }
| |_________^ help: try this: `matches!(self, Rollup(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/internal/subject_iterator.rs#L425
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/internal/subject_iterator.rs:425:42
|
425 | match lowest_pos.cmp(&lowest_neg) {
| ^^^^^^^^^^^ help: change this to: `lowest_neg`
|
= 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
|
this if-then-else expression assigns a bool literal:
src/layer/internal/predicate_iterator.rs#L86
warning: this if-then-else expression assigns a bool literal
--> src/layer/internal/predicate_iterator.rs:86:9
|
86 | / if next.is_none()
87 | | || next.map(|t| (t.subject, t.predicate)) != result.map(|t| (t.subject, t.predicate))
88 | | {
89 | | self.sp_boundary = true;
90 | | } else {
91 | | self.sp_boundary = false;
92 | | }
| |_________^ help: you can reduce it to: `self.sp_boundary = next.is_none() || next.map(|t| (t.subject, t.predicate)) != result.map(|t| (t.subject, t.predicate));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign
= note: `#[warn(clippy::needless_bool_assign)]` on by default
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/layer/internal/base_merge.rs#L223
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/layer/internal/base_merge.rs:223:31
|
223 | for (ix, input) in inputs.into_iter().enumerate() {
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L278
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:278:9
|
276 | let ids = self.builder.add_values(values);
| ------------------------------------------ unnecessary `let` binding
277 |
278 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
276 ~
277 |
278 ~ self.builder.add_values(values)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L262
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:262:9
|
260 | let ids = self.builder.add_predicates_bytes(predicates);
| -------------------------------------------------------- unnecessary `let` binding
261 |
262 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
260 ~
261 |
262 ~ self.builder.add_predicates_bytes(predicates)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L249
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:249:9
|
247 | let ids = self.builder.add_predicates(predicates);
| -------------------------------------------------- unnecessary `let` binding
248 |
249 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
247 ~
248 |
249 ~ self.builder.add_predicates(predicates)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L233
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:233:9
|
231 | let ids = self.builder.add_nodes_bytes(nodes);
| ---------------------------------------------- unnecessary `let` binding
232 |
233 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
231 ~
232 |
233 ~ self.builder.add_nodes_bytes(nodes)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L220
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:220:9
|
218 | let ids = self.builder.add_nodes(nodes);
| ---------------------------------------- unnecessary `let` binding
219 |
220 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
218 ~
219 |
220 ~ self.builder.add_nodes(nodes)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L204
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:204:9
|
202 | let id = self.builder.add_value(value);
| --------------------------------------- unnecessary `let` binding
203 |
204 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
202 ~
203 |
204 ~ self.builder.add_value(value)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L191
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:191:9
|
189 | let id = self.builder.add_predicate(predicate);
| ----------------------------------------------- unnecessary `let` binding
190 |
191 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
189 ~
190 |
191 ~ self.builder.add_predicate(predicate)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L178
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:178:9
|
176 | let id = self.builder.add_node(node);
| ------------------------------------- unnecessary `let` binding
177 |
178 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
176 ~
177 |
178 ~ self.builder.add_node(node)
|
|
this loop could be written as a `for` loop:
src/layer/builder.rs#L473
warning: this loop could be written as a `for` loop
--> src/layer/builder.rs:473:9
|
473 | while let Some((object, sp)) = merged_iters.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (object, sp) in merged_iters.by_ref()`
|
= 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
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L87
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:87:9
|
85 | let id = self.value_dictionary_builder.add(value);
| -------------------------------------------------- unnecessary `let` binding
86 |
87 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
85 ~
86 |
87 ~ self.value_dictionary_builder.add(value)
|
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L78
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:78:9
|
76 | let id = self.predicate_dictionary_builder.add(predicate);
| ---------------------------------------------------------- unnecessary `let` binding
77 |
78 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
76 ~
77 |
78 ~ self.predicate_dictionary_builder.add(predicate)
|
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L61
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:61:9
|
59 | let id = self.node_dictionary_builder.add(node);
| ------------------------------------------------ unnecessary `let` binding
60 |
61 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
59 ~
60 |
61 ~ self.node_dictionary_builder.add(node)
|
|
this `else { if .. }` block can be collapsed:
src/storage/locking.rs#L55
warning: this `else { if .. }` block can be collapsed
--> src/storage/locking.rs:55:28
|
55 | } else {
| ____________________________^
56 | | if !cfg!(feature = "noreadlock") {
57 | | file.lock_shared()
58 | | .expect("failed to acquire exclusive lock")
59 | | }
60 | | }
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
55 ~ } else if !cfg!(feature = "noreadlock") {
56 + file.lock_shared()
57 + .expect("failed to acquire exclusive lock")
58 + }
|
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L584
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:584:41
|
584 | pub const CHILD_LAYER_OPTIONAL_FILES: [&'static str; 4] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L550
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:550:41
|
550 | pub const CHILD_LAYER_REQUIRED_FILES: [&'static str; 31] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L547
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:547:40
|
547 | pub const BASE_LAYER_OPTIONAL_FILES: [&'static str; 2] =
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L529
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:529:40
|
529 | pub const BASE_LAYER_REQUIRED_FILES: [&'static str; 15] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L519
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:519:36
|
519 | pub const SHARED_OPTIONAL_FILES: [&'static str; 7] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L508
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:508:36
|
508 | pub const SHARED_REQUIRED_FILES: [&'static str; 8] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L27
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:27:13
|
27 | sp_o_adjacency_list: sp_o_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sp_o_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L26
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:26:13
|
26 | s_p_adjacency_list: s_p_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s_p_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L25
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:25:13
|
25 | subjects: subjects,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `subjects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L28
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:28:13
|
28 | s_p_adjacency_list: s_p_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s_p_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L27
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:27:13
|
27 | o_ps_adjacency_list: o_ps_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `o_ps_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L26
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:26:13
|
26 | objects: objects,
| ^^^^^^^^^^^^^^^^ help: replace it with: `objects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L25
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:25:13
|
25 | subjects: subjects,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `subjects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|
clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do:
src/storage/pack.rs#L171
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
|
writing `&PathBuf` instead of `&Path` involves a new object where a slice will do:
src/storage/pack.rs#L141
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
|
you should consider adding a `Default` implementation for `MemoryBackedStore`:
src/storage/memory.rs#L29
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 + }
|
|
deref on an immutable reference:
src/storage/delta.rs#L22
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/archive.rs#L1189
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
|
called `skip(..).next()` on an iterator:
src/storage/archive.rs#L1188
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
|
redundant pattern matching, consider using `is_pending()`:
src/storage/archive.rs#L1027
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
|
if let .. else expression looks like `matches!` macro:
src/storage/archive.rs#L671
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L516
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L511
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
|
deref which would be done by auto-deref:
src/storage/archive.rs#L500
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
|
using `clone` on type `[u32; 5]` which implements the `Copy` trait:
src/storage/archive.rs#L416
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
|
if let .. else expression looks like `matches!` macro:
src/storage/archive.rs#L372
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
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/archive.rs#L321
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
|
called `skip(..).next()` on an iterator:
src/storage/archive.rs#L318
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
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/storage/layer.rs#L2012
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
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/storage/layer.rs#L2011
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1970
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1969
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
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/storage/layer.rs#L1968
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1567
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?,
|
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1559
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1531
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
|
useless conversion to the same type: `layer::internal::InternalLayer`:
src/storage/layer.rs#L1526
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
|
unneeded late initialization:
src/storage/layer.rs#L1498
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 | };
| +
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/storage/file.rs#L446
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/storage/file.rs:446:1
|
446 | impl Into<AdjacencyList> for AdjacencyListMaps {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<storage::file::AdjacencyListMaps>`
|
446 ~ impl From<AdjacencyListMaps> for AdjacencyList {
447 ~ fn from(val: AdjacencyListMaps) -> Self {
448 | AdjacencyList::parse(
449 ~ val.nums_map,
450 ~ val.bitindex_maps.bits_map,
451 ~ val.bitindex_maps.blocks_map,
452 ~ val.bitindex_maps.sblocks_map,
|
|
an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true:
src/storage/file.rs#L405
warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
--> src/storage/file.rs:405:1
|
405 | impl Into<BitIndex> for BitIndexMaps {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
= note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<storage::file::BitIndexMaps>`
|
405 ~ impl From<BitIndexMaps> for BitIndex {
406 ~ fn from(val: BitIndexMaps) -> Self {
407 ~ BitIndex::from_maps(val.bits_map, val.blocks_map, val.sblocks_map)
|
|
this call to `from_str_radix` can be replaced with a call to `str::parse`:
src/storage/directory.rs#L229
warning: this call to `from_str_radix` can be replaced with a call to `str::parse`
--> src/storage/directory.rs:229:19
|
229 | let version = u64::from_str_radix(version_str, 10);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `version_str.parse::<u64>()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
= note: `#[warn(clippy::from_str_radix_10)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/storage/directory.rs#L214
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/storage/directory.rs:214:37
|
214 | let s = String::from_utf8_lossy(&data);
| ^^^^^ help: change this to: `data`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
module has the same name as its containing module:
src/logging/mod.rs#L7
warning: module has the same name as its containing module
--> src/logging/mod.rs:7:1
|
7 | pub mod logging;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
|
`if` chain can be rewritten with `match`:
src/layer/simple_builder.rs#L272
warning: `if` chain can be rewritten with `match`
--> src/layer/simple_builder.rs:272:13
|
272 | / if addition < removal {
273 | | additions_it.next();
274 | | } else if addition > removal {
275 | | let removal = removals_it.next().unwrap();
... |
288 | | *removal = IdTriple::new(0, 0, 0);
289 | | }
| |_____________^
|
= help: consider rewriting the `if` chain to use `cmp` and `match`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
= note: `#[warn(clippy::comparison_chain)]` on by default
|
mutable key type:
src/layer/layer.rs#L309
warning: mutable key type
--> src/layer/layer.rs:309:20
|
309 | value_map: &HashMap<TypedDictEntry, u64>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type
= note: `#[warn(clippy::mutable_key_type)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L273
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:273:65
|
273 | Self::Unresolved(u) => PossiblyResolved::Unresolved(&u),
| ^^ help: change this to: `u`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L134
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:134:38
|
134 | .object_value_id(&value)
| ^^^^^^ help: change this to: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L130
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:130:37
|
130 | .object_node_id(&node)
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L102
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:102:70
|
102 | ObjectType::Value(value) => self.object_value_id(&value),
| ^^^^^^ help: change this to: `value`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/layer.rs#L101
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/layer.rs:101:67
|
101 | ObjectType::Node(node) => self.object_node_id(&node),
| ^^^^^ help: change this to: `node`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
module has the same name as its containing module:
src/layer/mod.rs#L9
warning: module has the same name as its containing module
--> src/layer/mod.rs:9:1
|
9 | mod layer;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
= note: `#[warn(clippy::module_inception)]` on by default
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/layer/internal/mod.rs#L670
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/layer/internal/mod.rs:670:35
|
670 | if corrected_id > parent_count as u64 {
| ^^^^^^^^^^^^^^^^^^^ help: try: `parent_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/layer/internal/mod.rs#L639
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/layer/internal/mod.rs:639:35
|
639 | if corrected_id > parent_count as u64 {
| ^^^^^^^^^^^^^^^^^^^ help: try: `parent_count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
match expression looks like `matches!` macro:
src/layer/internal/mod.rs#L528
warning: match expression looks like `matches!` macro
--> src/layer/internal/mod.rs:528:9
|
528 | / match self {
529 | | Rollup(_) => true,
530 | | _ => false,
531 | | }
| |_________^ help: try this: `matches!(self, Rollup(_))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/layer/internal/subject_iterator.rs#L425
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/layer/internal/subject_iterator.rs:425:42
|
425 | match lowest_pos.cmp(&lowest_neg) {
| ^^^^^^^^^^^ help: change this to: `lowest_neg`
|
= 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
|
this if-then-else expression assigns a bool literal:
src/layer/internal/predicate_iterator.rs#L86
warning: this if-then-else expression assigns a bool literal
--> src/layer/internal/predicate_iterator.rs:86:9
|
86 | / if next.is_none()
87 | | || next.map(|t| (t.subject, t.predicate)) != result.map(|t| (t.subject, t.predicate))
88 | | {
89 | | self.sp_boundary = true;
90 | | } else {
91 | | self.sp_boundary = false;
92 | | }
| |_________^ help: you can reduce it to: `self.sp_boundary = next.is_none() || next.map(|t| (t.subject, t.predicate)) != result.map(|t| (t.subject, t.predicate));`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign
= note: `#[warn(clippy::needless_bool_assign)]` on by default
|
this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/layer/internal/base_merge.rs#L223
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/layer/internal/base_merge.rs:223:31
|
223 | for (ix, input) in inputs.into_iter().enumerate() {
| ^^^^^^^^^ help: call directly: `iter`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
= note: `#[warn(clippy::into_iter_on_ref)]` on by default
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L278
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:278:9
|
276 | let ids = self.builder.add_values(values);
| ------------------------------------------ unnecessary `let` binding
277 |
278 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
276 ~
277 |
278 ~ self.builder.add_values(values)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L262
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:262:9
|
260 | let ids = self.builder.add_predicates_bytes(predicates);
| -------------------------------------------------------- unnecessary `let` binding
261 |
262 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
260 ~
261 |
262 ~ self.builder.add_predicates_bytes(predicates)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L249
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:249:9
|
247 | let ids = self.builder.add_predicates(predicates);
| -------------------------------------------------- unnecessary `let` binding
248 |
249 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
247 ~
248 |
249 ~ self.builder.add_predicates(predicates)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L233
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:233:9
|
231 | let ids = self.builder.add_nodes_bytes(nodes);
| ---------------------------------------------- unnecessary `let` binding
232 |
233 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
231 ~
232 |
233 ~ self.builder.add_nodes_bytes(nodes)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L220
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:220:9
|
218 | let ids = self.builder.add_nodes(nodes);
| ---------------------------------------- unnecessary `let` binding
219 |
220 | ids
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
218 ~
219 |
220 ~ self.builder.add_nodes(nodes)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L204
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:204:9
|
202 | let id = self.builder.add_value(value);
| --------------------------------------- unnecessary `let` binding
203 |
204 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
202 ~
203 |
204 ~ self.builder.add_value(value)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L191
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:191:9
|
189 | let id = self.builder.add_predicate(predicate);
| ----------------------------------------------- unnecessary `let` binding
190 |
191 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
189 ~
190 |
191 ~ self.builder.add_predicate(predicate)
|
|
returning the result of a `let` binding from a block:
src/layer/internal/base.rs#L178
warning: returning the result of a `let` binding from a block
--> src/layer/internal/base.rs:178:9
|
176 | let id = self.builder.add_node(node);
| ------------------------------------- unnecessary `let` binding
177 |
178 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
176 ~
177 |
178 ~ self.builder.add_node(node)
|
|
this loop could be written as a `for` loop:
src/layer/builder.rs#L473
warning: this loop could be written as a `for` loop
--> src/layer/builder.rs:473:9
|
473 | while let Some((object, sp)) = merged_iters.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for (object, sp) in merged_iters.by_ref()`
|
= 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
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L87
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:87:9
|
85 | let id = self.value_dictionary_builder.add(value);
| -------------------------------------------------- unnecessary `let` binding
86 |
87 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
85 ~
86 |
87 ~ self.value_dictionary_builder.add(value)
|
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L78
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:78:9
|
76 | let id = self.predicate_dictionary_builder.add(predicate);
| ---------------------------------------------------------- unnecessary `let` binding
77 |
78 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
76 ~
77 |
78 ~ self.predicate_dictionary_builder.add(predicate)
|
|
returning the result of a `let` binding from a block:
src/layer/builder.rs#L61
warning: returning the result of a `let` binding from a block
--> src/layer/builder.rs:61:9
|
59 | let id = self.node_dictionary_builder.add(node);
| ------------------------------------------------ unnecessary `let` binding
60 |
61 | id
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
59 ~
60 |
61 ~ self.node_dictionary_builder.add(node)
|
|
this `else { if .. }` block can be collapsed:
src/storage/locking.rs#L55
warning: this `else { if .. }` block can be collapsed
--> src/storage/locking.rs:55:28
|
55 | } else {
| ____________________________^
56 | | if !cfg!(feature = "noreadlock") {
57 | | file.lock_shared()
58 | | .expect("failed to acquire exclusive lock")
59 | | }
60 | | }
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
55 ~ } else if !cfg!(feature = "noreadlock") {
56 + file.lock_shared()
57 + .expect("failed to acquire exclusive lock")
58 + }
|
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L584
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:584:41
|
584 | pub const CHILD_LAYER_OPTIONAL_FILES: [&'static str; 4] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L550
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:550:41
|
550 | pub const CHILD_LAYER_REQUIRED_FILES: [&'static str; 31] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L547
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:547:40
|
547 | pub const BASE_LAYER_OPTIONAL_FILES: [&'static str; 2] =
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L529
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:529:40
|
529 | pub const BASE_LAYER_REQUIRED_FILES: [&'static str; 15] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L519
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:519:36
|
519 | pub const SHARED_OPTIONAL_FILES: [&'static str; 7] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
|
constants have by default a `'static` lifetime:
src/storage/consts.rs#L508
warning: constants have by default a `'static` lifetime
--> src/storage/consts.rs:508:36
|
508 | pub const SHARED_REQUIRED_FILES: [&'static str; 8] = [
| -^^^^^^^---- help: consider removing `'static`: `&str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L27
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:27:13
|
27 | sp_o_adjacency_list: sp_o_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sp_o_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L26
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:26:13
|
26 | s_p_adjacency_list: s_p_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s_p_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/subject_iterator.rs#L25
warning: redundant field names in struct initialization
--> src/layer/internal/subject_iterator.rs:25:13
|
25 | subjects: subjects,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `subjects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L28
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:28:13
|
28 | s_p_adjacency_list: s_p_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `s_p_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L27
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:27:13
|
27 | o_ps_adjacency_list: o_ps_adjacency_list,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `o_ps_adjacency_list`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L26
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:26:13
|
26 | objects: objects,
| ^^^^^^^^^^^^^^^^ help: replace it with: `objects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
|
redundant field names in struct initialization:
src/layer/internal/object_iterator.rs#L25
warning: redundant field names in struct initialization
--> src/layer/internal/object_iterator.rs:25:13
|
25 | subjects: subjects,
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `subjects`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
|