f64 retrieval from typed dict entries #604
clippy
121 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 121 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 266 in src/structure/wavelettree.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
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
Check warning on line 171 in src/structure/wavelettree.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
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
Check warning on line 125 in src/structure/wavelettree.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
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
Check warning on line 101 in src/structure/wavelettree.rs
github-actions / clippy
struct `WaveletTree` has a public `len` method, but no `is_empty` method
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
Check warning on line 43 in src/structure/wavelettree.rs
github-actions / clippy
struct `WaveletLookup` has a public `len` method, but no `is_empty` method
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
Check warning on line 43 in src/structure/util.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/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
Check warning on line 482 in src/structure/tfc/typed.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/tfc/typed.rs:482:23
|
482 | .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
Check warning on line 474 in src/structure/tfc/typed.rs
github-actions / clippy
called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()`
--> src/structure/tfc/typed.rs:472:13
|
472 | / self.sized_dict_buf_builder
473 | | .as_mut()
474 | | .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
|
472 ~ if let Some(b) = self.sized_dict_buf_builder
473 + .as_mut() { ... }
|
Check warning on line 400 in src/structure/tfc/typed.rs
github-actions / clippy
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:398:5
|
398 | / pub fn into_iter(self) -> impl Iterator<Item = SizedDictEntry> + Clone {
399 | | self.0.into_iter()
400 | | }
| |_____^
|
= 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
Check warning on line 394 in src/structure/tfc/typed.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:394:17
|
394 | 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
|
394 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
394 + pub fn iter(&self) -> impl Iterator<Item = SizedDictEntry> + '_ + Clone {
|
Check warning on line 367 in src/structure/tfc/typed.rs
github-actions / clippy
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:365:5
|
365 | / pub fn into_iter(self) -> impl Iterator<Item = SizedDictEntry> + Clone {
366 | | self.dict.into_iter()
367 | | }
| |_____^
|
= 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
Check warning on line 361 in src/structure/tfc/typed.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:361:17
|
361 | 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
|
361 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = SizedDictEntry> + 'a + Clone {
361 + pub fn iter(&self) -> impl Iterator<Item = SizedDictEntry> + '_ + Clone {
|
Check warning on line 305 in src/structure/tfc/typed.rs
github-actions / clippy
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
warning: method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
--> src/structure/tfc/typed.rs:299:5
|
299 | / pub fn into_iter(self) -> impl Iterator<Item = TypedDictEntry> + Clone {
300 | | self.into_block_iter().flat_map(|(datatype, segment)| {
301 | | segment
302 | | .into_iter()
303 | | .map(move |entry| TypedDictEntry::new(datatype, entry))
304 | | })
305 | | }
| |_____^
|
= 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
Check warning on line 291 in src/structure/tfc/typed.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:291:17
|
291 | 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
|
291 - pub fn iter<'a>(&'a self) -> impl Iterator<Item = TypedDictEntry> + 'a + Clone {
291 + pub fn iter(&self) -> impl Iterator<Item = TypedDictEntry> + '_ + Clone {
|
Check warning on line 273 in src/structure/tfc/typed.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:273:23
|
273 | pub fn block_iter<'a>(
| ^^
274 | &'a self,
| ^^
275 | ) -> 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
|
273 ~ pub fn block_iter(
274 ~ &self,
275 ~ ) -> impl Iterator<Item = (Datatype, SizedDictBlock)> + '_ + Clone {
|
Check warning on line 261 in src/structure/tfc/typed.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/structure/tfc/typed.rs:261:33
|
261 | 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
Check warning on line 259 in src/structure/tfc/typed.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/typed.rs:259:25
|
259 | 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
|
259 - pub fn segment_iter<'a>(&'a self) -> DictSegmentIterator<'a> {
259 + pub fn segment_iter(&self) -> DictSegmentIterator<'_> {
|
Check warning on line 211 in src/structure/tfc/typed.rs
github-actions / clippy
manual implementation of `Option::map`
warning: manual implementation of `Option::map`
--> src/structure/tfc/typed.rs:207:9
|
207 | / if let Some(i) = self.types_present.index_of(dt as u64) {
208 | | Some(self.inner_type_segment(i))
209 | | } else {
210 | | None
211 | | }
| |_________^ help: try: `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
Check warning on line 202 in src/structure/tfc/typed.rs
github-actions / clippy
casting to the same type is unnecessary (`u64` -> `u64`)
warning: casting to the same type is unnecessary (`u64` -> `u64`)
--> src/structure/tfc/typed.rs:202:13
|
202 | 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
Check warning on line 170 in src/structure/tfc/typed.rs
github-actions / clippy
casting to the same type is unnecessary (`usize` -> `usize`)
warning: casting to the same type is unnecessary (`usize` -> `usize`)
--> src/structure/tfc/typed.rs:170:53
|
170 | 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
Check warning on line 33 in src/structure/tfc/stream.rs
github-actions / clippy
very complex type used. Consider factoring parts into `type` definitions
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
Check warning on line 243 in src/structure/tfc/dict.rs
github-actions / clippy
method `into_iter` can be confused for the standard trait method `std::iter::IntoIterator::into_iter`
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
Check warning on line 237 in src/structure/tfc/dict.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/dict.rs:237:17
|
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 {
|
Check warning on line 223 in src/structure/tfc/dict.rs
github-actions / clippy
the following explicit lifetimes could be elided: 'a
warning: the following explicit lifetimes could be elided: 'a
--> src/structure/tfc/dict.rs:223:23
|
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<'_> {
|
Check warning on line 220 in src/structure/tfc/dict.rs
github-actions / clippy
returning the result of a `let` binding from a block
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)
|