shortcut: layer does not fit in cache if cache is set to 0 #532
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention
Annotations
3 errors and 121 warnings
build-and-test (windows-latest, msys2)
Process completed with exit code 101.
|
build-and-test (macos-latest, bash)
The job was canceled because "windows-latest_msys2" failed.
|
build-and-test (macos-latest, bash)
The operation was canceled.
|
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do:
src/structure/wavelettree.rs#L266
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> src/structure/wavelettree.rs:266:54
|
266 | fn push_to_fragments(num: u64, width: u8, fragments: &mut Vec<FragmentBuilder>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&mut [FragmentBuilder]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/structure/wavelettree.rs#L171
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/wavelettree.rs:171:32
|
171 | let mut alphabet_end = 2_u64.pow(self.num_layers as u32) as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2_u64.pow(self.num_layers as u32)`
|
= 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/structure/wavelettree.rs#L125
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/wavelettree.rs:125:32
|
125 | let mut alphabet_end = 2_u64.pow(self.num_layers as u32) as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `2_u64.pow(self.num_layers as u32)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
struct `WaveletTree` has a public `len` method, but no `is_empty` method:
src/structure/wavelettree.rs#L101
warning: struct `WaveletTree` has a public `len` method, but no `is_empty` method
--> src/structure/wavelettree.rs:101:5
|
101 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
|
struct `WaveletLookup` has a public `len` method, but no `is_empty` method:
src/structure/wavelettree.rs#L43
warning: struct `WaveletLookup` has a public `len` method, but no `is_empty` method
--> src/structure/wavelettree.rs:43:5
|
43 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/structure/util.rs#L43
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/structure/util.rs:43:17
|
43 | w.write_all(&bytes).await?;
| ^^^^^^ help: change this to: `bytes`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/structure/tfc/typed.rs#L456
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/tfc/typed.rs:456:23
|
456 | .push(block_offset_builder.count() as u64 - 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `block_offset_builder.count()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`:
src/structure/tfc/typed.rs#L446
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/structure/tfc/typed.rs:446:13
|
446 | / self.sized_dict_buf_builder
447 | | .as_mut()
448 | | .map(|b| b.record_size = value.datatype.record_size());
| |______________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn
= note: `#[warn(clippy::option_map_unit_fn)]` on by default
help: try this
|
446 ~ if let Some(b) = self.sized_dict_buf_builder
447 + .as_mut() { ... }
|
|
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`:
src/structure/tfc/typed.rs#L372
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:372:5
|
372 | / pub fn into_iter(self) -> impl Iterator<Item = SizedDictEntry> + Clone {
373 | | self.0.into_iter()
374 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::IntoIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/typed.rs#L368
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:368:5
|
368 | pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
368 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
368 + pub fn iter(&self) -> impl Iterator<Item = SizedDictEntry> + '_ + Clone {
|
|
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`:
src/structure/tfc/typed.rs#L339
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:339:5
|
339 | / pub fn into_iter(self) -> impl Iterator<Item = SizedDictEntry> + Clone {
340 | | self.dict.into_iter()
341 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::IntoIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/typed.rs#L335
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:335:5
|
335 | pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
335 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
335 + pub fn iter(&self) -> impl Iterator<Item = SizedDictEntry> + '_ + Clone {
|
|
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`:
src/structure/tfc/typed.rs#L273
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:273:5
|
273 | / pub fn into_iter(self) -> impl Iterator<Item = TypedDictEntry> + Clone {
274 | | self.into_block_iter().flat_map(|(datatype, segment)| {
275 | | segment
276 | | .into_iter()
277 | | .map(move |entry| TypedDictEntry::new(datatype, entry))
278 | | })
279 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::IntoIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/typed.rs#L265
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:265:5
|
265 | pub fn iter<'a>(&'a self) -> impl Iterator<Item = TypedDictEntry> + 'a + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
265 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = TypedDictEntry> + 'a + Clone {
265 + pub fn iter(&self) -> impl Iterator<Item = TypedDictEntry> + '_ + Clone {
|
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/typed.rs#L247
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:247:5
|
247 | / pub fn block_iter<'a>(
248 | | &'a self,
249 | | ) -> impl Iterator<Item = (Datatype, SizedDictBlock)> + 'a + Clone {
| |______________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
247 ~ pub fn block_iter(
248 ~ &self,
249 ~ ) -> impl Iterator<Item = (Datatype, SizedDictBlock)> + '_ + Clone {
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/structure/tfc/typed.rs#L235
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/structure/tfc/typed.rs:235:33
|
235 | dict: Cow::Borrowed(&self),
| ^^^^^ help: change this to: `self`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/typed.rs#L233
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:233:5
|
233 | pub fn segment_iter<'a>(&'a self) -> DictSegmentIterator<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
233 - pub fn segment_iter<'a>(&'a self) -> DictSegmentIterator<'a> {
233 + pub fn segment_iter(&self) -> DictSegmentIterator<'_> {
|
|
manual implementation of `Option::map`:
src/structure/tfc/typed.rs#L181
warning: manual implementation of `Option::map`
--> src/structure/tfc/typed.rs:181:9
|
181 | / if let Some(i) = self.types_present.index_of(dt as u64) {
182 | | Some(self.inner_type_segment(i))
183 | | } else {
184 | | None
185 | | }
| |_________^ help: try this: `self.types_present.index_of(dt as u64).map(|i| self.inner_type_segment(i))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
= note: `#[warn(clippy::manual_map)]` on by default
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/structure/tfc/typed.rs#L176
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/tfc/typed.rs:176:13
|
176 | id_offset as u64,
| ^^^^^^^^^^^^^^^^ help: try: `id_offset`
|
= 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/structure/tfc/typed.rs#L144
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/structure/tfc/typed.rs:144:53
|
144 | block_offset = self.block_offsets.entry(type_offset as usize) as usize;
| ^^^^^^^^^^^^^^^^^^^^ help: try: `type_offset`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
very complex type used. Consider factoring parts into `type` definitions:
src/structure/tfc/stream.rs#L23
warning: very complex type used. Consider factoring parts into `type` definitions
--> src/structure/tfc/stream.rs:23:9
|
23 | / Pin<
24 | | Box<
25 | | dyn Future<
26 | | Output = Result<
... |
32 | | >,
33 | | >,
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
= note: `#[warn(clippy::type_complexity)]` on by default
|
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`:
src/structure/tfc/dict.rs#L241
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/dict.rs:241:5
|
241 | / pub fn into_iter(self) -> impl Iterator<Item = SizedDictEntry> + Clone {
242 | | self.into_block_iter().flat_map(|b| b.into_iter())
243 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::IntoIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/dict.rs#L237
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/dict.rs:237:5
|
237 | pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
237 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
237 + pub fn iter(&self) -> impl Iterator<Item = SizedDictEntry> + '_ + Clone {
|
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/dict.rs#L223
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/dict.rs:223:5
|
223 | pub fn block_iter<'a>(&'a self) -> SizedDictBlockIterator<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
223 - pub fn block_iter<'a>(&'a self) -> SizedDictBlockIterator<'a> {
223 + pub fn block_iter(&self) -> SizedDictBlockIterator<'_> {
|
|
returning the result of a `let` binding from a block:
src/structure/tfc/dict.rs#L220
warning: returning the result of a `let` binding from a block
--> src/structure/tfc/dict.rs:220:9
|
207 | let result = block_id.offset(offset).default(offset - 1);
| --------------------------------------------------------- unnecessary `let` binding
...
220 | result
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
207 ~
208 | /*
...
219 |
220 ~ block_id.offset(offset).default(offset - 1)
|
|
casting to the same type is unnecessary (`usize` -> `usize`):
src/structure/tfc/dict.rs#L172
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/structure/tfc/dict.rs:172:26
|
172 | Some(block.entry(((index - 1) % 8) as usize))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((index - 1) % 8)`
|
= 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/structure/tfc/dict.rs#L171
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/structure/tfc/dict.rs:171:32
|
171 | let block = self.block(((index - 1) / 8) as usize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((index - 1) / 8)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
unneeded late initialization:
src/structure/tfc/dict.rs#L134
warning: unneeded late initialization
--> src/structure/tfc/dict.rs:134:9
|
134 | let block_bytes;
| ^^^^^^^^^^^^^^^^ created here
135 | block_bytes = self.data.slice(offset..);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `block_bytes` here
|
135 | let block_bytes = self.data.slice(offset..);
| ~~~~~~~~~~~~~~~
|
unneeded late initialization:
src/structure/tfc/dict.rs#L119
warning: unneeded late initialization
--> src/structure/tfc/dict.rs:119:9
|
119 | let offset: usize;
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `offset` here
|
120 | let offset: usize = if block_index == 0 {
| +++++++++++++++++++
help: remove the assignments from the branches
|
121 ~ 0
122 | } else {
123 ~ (self.offsets.entry(block_index - 1) - self.dict_offset) as usize
|
help: add a semicolon after the `if` expression
|
124 | };
| +
|
length comparison to zero:
src/structure/tfc/dict.rs#L69
warning: length comparison to zero
--> src/structure/tfc/dict.rs:69:12
|
69 | if self.current_block.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.current_block.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
the loop variable `i` is only used to index `suffix`:
src/structure/tfc/decimal.rs#L147
warning: the loop variable `i` is only used to index `suffix`
--> src/structure/tfc/decimal.rs:147:18
|
147 | for i in 0..suffix.len() {
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
help: consider using an iterator
|
147 | for <item> in &mut suffix {
| ~~~~~~ ~~~~~~~~~~~
|
returning the result of a `let` binding from a block:
src/structure/tfc/decimal.rs#L131
warning: returning the result of a `let` binding from a block
--> src/structure/tfc/decimal.rs:131:5
|
125 | / let decimal = if fraction.is_empty() {
126 | | format!("{int:}")
127 | | } else {
128 | | let sign = if int == 0 && !is_pos { "-" } else { "" };
129 | | format!("{sign:}{int:}.{fraction:}")
130 | | };
| |______- unnecessary `let` binding
131 | decimal
| ^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
125 ~
126 ~ if fraction.is_empty() {
127 + format!("{int:}")
128 + } else {
129 + let sign = if int == 0 && !is_pos { "-" } else { "" };
130 + format!("{sign:}{int:}.{fraction:}")
131 + }
|
|
binary comparison to literal `Option::None`:
src/structure/tfc/block.rs#L803
warning: binary comparison to literal `Option::None`
--> src/structure/tfc/block.rs:803:12
|
803 | if record_size == None {
| ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `record_size.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
|
the loop variable `i` is only used to index `slices`:
src/structure/tfc/block.rs#L796
warning: the loop variable `i` is only used to index `slices`
--> src/structure/tfc/block.rs:796:14
|
796 | for i in 1..slices.len() {
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator
|
796 | for <item> in slices.iter().skip(1) {
| ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
|
casting to the same type is unnecessary (`u8` -> `u8`):
src/structure/tfc/block.rs#L782
warning: casting to the same type is unnecessary (`u8` -> `u8`)
--> src/structure/tfc/block.rs:782:16
|
782 | buf.put_u8(cw as u8);
| ^^^^^^^^ help: try: `cw`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
redundant clone:
src/structure/tfc/block.rs#L647
warning: redundant clone
--> src/structure/tfc/block.rs:647:28
|
647 | data: self.data.clone(),
| ^^^^^^^^ help: remove this
|
note: this value is dropped without further use
--> src/structure/tfc/block.rs:647:19
|
647 | data: self.data.clone(),
| ^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: `#[warn(clippy::redundant_clone)]` on by default
|
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`:
src/structure/tfc/block.rs#L644
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/block.rs:644:5
|
644 | / pub fn into_iter(self) -> OwnedSizedBlockIterator {
645 | | SizedBlockIterator {
646 | | header: Cow::Owned(self.header),
647 | | data: self.data.clone(),
... |
650 | | }
651 | | }
| |_____^
|
= help: consider implementing the trait `std::iter::IntoIterator` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/block.rs#L635
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/block.rs:635:5
|
635 | pub fn iter<'a>(&'a self) -> SizedBlockIterator<'a> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
635 - pub fn iter<'a>(&'a self) -> SizedBlockIterator<'a> {
635 + pub fn iter(&self) -> SizedBlockIterator<'_> {
|
|
`if` chain can be rewritten with `match`:
src/structure/tfc/block.rs#L615
warning: `if` chain can be rewritten with `match`
--> src/structure/tfc/block.rs:615:13
|
615 | / if *shared < common_prefix {
616 | | return IdLookupResult::Closest(ix as u64);
617 | | } else if *shared > common_prefix {
618 | | continue;
619 | | }
| |_____________^
|
= 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
|
the following explicit lifetimes could be elided: 'a:
src/structure/tfc/block.rs#L586
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/block.rs:586:5
|
586 | fn suffixes<'a>(&'a self) -> impl Iterator<Item = Bytes> + 'a {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
586 - fn suffixes<'a>(&'a self) -> impl Iterator<Item = Bytes> + 'a {
586 + fn suffixes(&self) -> impl Iterator<Item = Bytes> + '_ {
|
|
unneeded late initialization:
src/structure/tfc/block.rs#L569
warning: unneeded late initialization
--> src/structure/tfc/block.rs:569:13
|
569 | let slice;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `slice` here
|
570 | let slice = if ix == 0 && start == 0 {
| +++++++++++
help: remove the assignments from the branches
|
572 ~ self.header.head.slice(..have_to_take)
573 | } else {
574 ~ self.data.slice(cur_offset..cur_offset + have_to_take)
|
help: add a semicolon after the `if` expression
|
575 | };
| +
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/structure/tfc/block.rs#L406
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/structure/tfc/block.rs:406:42
|
406 | SizedDictEntry::Single(b) => &b,
| ^^ help: change this to: `b`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
enum `SizedDictEntry` has a public `len` method, but no `is_empty` method:
src/structure/tfc/block.rs#L230
warning: enum `SizedDictEntry` has a public `len` method, but no `is_empty` method
--> src/structure/tfc/block.rs:230:5
|
230 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
|
binary comparison to literal `Option::None`:
src/structure/tfc/block.rs#L120
warning: binary comparison to literal `Option::None`
--> src/structure/tfc/block.rs:120:27
|
120 | let size = if record_size == None {
| ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `record_size.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
|
binary comparison to literal `Option::None`:
src/structure/tfc/block.rs#L84
warning: binary comparison to literal `Option::None`
--> src/structure/tfc/block.rs:84:27
|
84 | let size = if record_size == None {
| ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `record_size.is_none()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
= note: `#[warn(clippy::partialeq_to_none)]` on by default
|
useless conversion to the same type: `u64`:
src/structure/logarray.rs#L484
warning: useless conversion to the same type: `u64`
--> src/structure/logarray.rs:484:12
|
484 | if u64::from(self.count) * u64::from(self.width) & 0b11_1111 != 0 {
| ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `u64::from()`: `self.count`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
useless conversion to the same type: `u32`:
src/structure/logarray.rs#L443
warning: useless conversion to the same type: `u32`
--> src/structure/logarray.rs:443:34
|
443 | if val.leading_zeros() < u32::from(leading_zeros) {
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `u32::from()`: `leading_zeros`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
returning the result of a `let` binding from a block:
src/structure/logarray.rs#L259
warning: returning the result of a `let` binding from a block
--> src/structure/logarray.rs:259:5
|
257 | let num_bytes = num_u64 * 8;
| ---------------------------- unnecessary `let` binding
258 |
259 | num_bytes
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
help: return the expression directly
|
257 ~
258 |
259 ~ num_u64 * 8
|
|
this loop could be written as a `for` loop:
src/structure/bitindex.rs#L454
warning: this loop could be written as a `for` loop
--> src/structure/bitindex.rs:454:5
|
454 | while let Some(chunk) = iter.next() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for chunk in iter`
|
= 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
|
the following explicit lifetimes could be elided: 'a:
src/structure/bitindex.rs#L440
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/bitindex.rs:440:1
|
440 | / pub fn build_bitindex_from_block_iter<'a, I: Iterator<Item = u64>, B1: BufMut, B2: BufMut>(
441 | | blocks_iter: &'a mut I,
442 | | blocks: &mut B1,
443 | | sblocks: &mut B2,
444 | | ) {
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
440 ~ pub fn build_bitindex_from_block_iter<I: Iterator<Item = u64>, B1: BufMut, B2: BufMut>(
441 ~ blocks_iter: &mut I,
|
|
casting to the same type is unnecessary (`u64` -> `u64`):
src/structure/bitindex.rs#L246
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/bitindex.rs:246:33
|
246 | return Some(i as u64);
| ^^^^^^^^ help: try: `i`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
struct `BitIndex` has a public `len` method, but no `is_empty` method:
src/structure/bitindex.rs#L65
warning: struct `BitIndex` has a public `len` method, but no `is_empty` method
--> src/structure/bitindex.rs:65:5
|
65 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
= note: `#[warn(clippy::len_without_is_empty)]` on by default
|
unneeded `return` statement:
src/store/mod.rs#L138
warning: unneeded `return` statement
--> src/store/mod.rs:138:17
|
138 | / return Err(io::Error::new(
139 | | io::ErrorKind::InvalidData,
140 | | "builder has already been committed",
141 | | ))
| |__________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
= help: remove `return`
|
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#L1157
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/storage/archive.rs:1157:40
|
1157 | 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#L1156
warning: called `skip(..).next()` on an iterator
--> src/storage/archive.rs:1156:41
|
1156 | 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#L995
warning: redundant pattern matching, consider using `is_pending()`
--> src/storage/archive.rs:995:16
|
995 | 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#L639
warning: if let .. else expression looks like `matches!` macro
--> src/storage/archive.rs:639:9
|
639 | / if let ConstructionFileState::Finalized(_) = &*guard {
640 | | true
641 | | } else {
642 | | false
643 | | }
| |_________^ 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#L484
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:484:41
|
484 | 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#L479
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:479:45
|
479 | ... 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#L468
warning: deref which would be done by auto-deref
--> src/storage/archive.rs:468:29
|
468 | ... &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#L381
warning: using `clone` on type `[u32; 5]` which implements the `Copy` trait
--> src/storage/archive.rs:381:22
|
381 | 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#L337
warning: if let .. else expression looks like `matches!` macro
--> src/storage/archive.rs:337:9
|
337 | / if let Self::Resolving(_) = self {
338 | | true
339 | | } else {
340 | | false
341 | | }
| |_________^ 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#L295
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/storage/archive.rs:295:32
|
295 | 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#L294
warning: called `skip(..).next()` on an iterator
--> src/storage/archive.rs:294:32
|
294 | let name = data.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
= 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` implentation 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` implentation 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#L211
warning: this call to `from_str_radix` can be replaced with a call to `str::parse`
--> src/storage/directory.rs:211:19
|
211 | 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#L196
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/storage/directory.rs:196:37
|
196 | 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
|
`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 `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`:
src/layer/internal/base_merge.rs#L222
warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
--> src/layer/internal/base_merge.rs:222:31
|
222 | 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)
|
|
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
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions-rs/clippy-check@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
|