fix compile error in newer nightly versions #1794
clippy
19 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 19 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.79.0-nightly (aed2187d5 2024-04-27)
- cargo 1.79.0-nightly (b60a15551 2024-04-26)
- clippy 0.1.79 (aed2187 2024-04-27)
Annotations
Check warning on line 25 in azalea/src/container.rs
github-actions / clippy
use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
--> azalea/src/container.rs:25:5
|
25 | async fn open_container(&mut self, pos: BlockPos) -> Option<ContainerHandle>;
| ^^^^^
|
= note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
|
25 - async fn open_container(&mut self, pos: BlockPos) -> Option<ContainerHandle>;
25 + fn open_container(&mut self, pos: BlockPos) -> impl std::future::Future<Output = Option<ContainerHandle>> + Send;
|
Check warning on line 84 in azalea/src/bot.rs
github-actions / clippy
use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
--> azalea/src/bot.rs:84:5
|
84 | async fn mine(&mut self, position: BlockPos);
| ^^^^^
|
= note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
= note: `#[warn(async_fn_in_trait)]` on by default
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
|
84 - async fn mine(&mut self, position: BlockPos);
84 + fn mine(&mut self, position: BlockPos) -> impl std::future::Future<Output = ()> + Send;
|
Check warning on line 240 in azalea/src/pathfinder/mod.rs
github-actions / clippy
assigning the result of `ToOwned::to_owned()` may be inefficient
warning: assigning the result of `ToOwned::to_owned()` may be inefficient
--> azalea/src/pathfinder/mod.rs:240:17
|
240 | pathfinder.path = path.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `path.clone_into(&mut pathfinder.path)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 162 in azalea/src/pathfinder/astar.rs
github-actions / clippy
field `f_score` is never read
warning: field `f_score` is never read
--> azalea/src/pathfinder/astar.rs:162:9
|
157 | pub struct Node<P, M> {
| ---- field in this struct
...
162 | pub f_score: f32,
| ^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 4 in azalea/src/lib.rs
github-actions / clippy
the feature `async_fn_in_trait` has been stable since 1.75.0 and no longer requires an attribute to enable
warning: the feature `async_fn_in_trait` has been stable since 1.75.0 and no longer requires an attribute to enable
--> azalea/src/lib.rs:4:12
|
4 | #![feature(async_fn_in_trait)]
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(stable_features)]` on by default
Check warning on line 80 in azalea-client/src/task_pool.rs
github-actions / clippy
usage of a legacy numeric constant
warning: usage of a legacy numeric constant
--> azalea-client/src/task_pool.rs:80:30
|
80 | max_threads: std::usize::MAX,
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
80 | max_threads: usize::MAX,
| ~~~~~~~~~~
Check warning on line 61 in azalea-client/src/task_pool.rs
github-actions / clippy
usage of a legacy numeric constant
warning: usage of a legacy numeric constant
--> azalea-client/src/task_pool.rs:61:32
|
61 | max_total_threads: std::usize::MAX,
| ^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
|
61 | max_total_threads: usize::MAX,
| ~~~~~~~~~~
Check warning on line 530 in azalea-client/src/packet_handling.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> azalea-client/src/packet_handling.rs:530:29
|
530 | ... info.display_name = updated_info.display_name.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `info.display_name.clone_from(&updated_info.display_name)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 212 in azalea-physics/src/collision/mergers.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> azalea-physics/src/collision/mergers.rs:212:12
|
212 | upper: &Vec<f64>,
| ^^^^^^^^^ help: change this to: `&[f64]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 211 in azalea-physics/src/collision/mergers.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> azalea-physics/src/collision/mergers.rs:211:12
|
211 | lower: &Vec<f64>,
| ^^^^^^^^^ help: change this to: `&[f64]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 141 in azalea-physics/src/collision/mergers.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> azalea-physics/src/collision/mergers.rs:141:48
|
141 | pub fn new_indirect(var1: &Vec<f64>, var2: &Vec<f64>, var3: bool, var4: bool) -> Self {
| ^^^^^^^^^ help: change this to: `&[f64]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 141 in azalea-physics/src/collision/mergers.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> azalea-physics/src/collision/mergers.rs:141:31
|
141 | pub fn new_indirect(var1: &Vec<f64>, var2: &Vec<f64>, var3: bool, var4: bool) -> Self {
| ^^^^^^^^^ help: change this to: `&[f64]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
Check warning on line 18 in azalea-physics/src/collision/world_collisions.rs
github-actions / clippy
field `only_suffocating_blocks` is never read
warning: field `only_suffocating_blocks` is never read
--> azalea-physics/src/collision/world_collisions.rs:18:9
|
13 | pub struct BlockCollisions<'a> {
| --------------- field in this struct
...
18 | pub only_suffocating_blocks: bool,
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 83 in azalea-brigadier/src/context/command_context_builder.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> azalea-brigadier/src/context/command_context_builder.rs:83:9
|
83 | self.modifier = node.read().modifier.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.modifier.clone_from(&node.read().modifier)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
Check warning on line 66 in azalea-brigadier/src/context/command_context_builder.rs
github-actions / clippy
assigning the result of `Clone::clone()` may be inefficient
warning: assigning the result of `Clone::clone()` may be inefficient
--> azalea-brigadier/src/context/command_context_builder.rs:66:9
|
66 | self.command = command.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.command.clone_from(command)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note: `#[warn(clippy::assigning_clones)]` on by default
Check warning on line 441 in azalea-auth/src/auth.rs
github-actions / clippy
accessing first element with `res.display_claims["xui"].get(0)`
warning: accessing first element with `res.display_claims["xui"].get(0)`
--> azalea-auth/src/auth.rs:441:24
|
441 | user_hash: res.display_claims["xui"].get(0).unwrap()["uhs"].clone(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `res.display_claims["xui"].first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
Check warning on line 259 in azalea-brigadier/src/tree/mod.rs
github-actions / clippy
lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons`
warning: lint `clippy::vtable_address_comparisons` has been renamed to `ambiguous_wide_pointer_comparisons`
--> azalea-brigadier/src/tree/mod.rs:259:25
|
259 | #[allow(clippy::vtable_address_comparisons)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
Check warning on line 140 in azalea-buf/src/write.rs
github-actions / clippy
usage of a legacy numeric method
warning: usage of a legacy numeric method
--> azalea-buf/src/write.rs:140:42
|
140 | value = (value >> 7) & (i64::max_value() >> 6);
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
|
140 | value = (value >> 7) & (i64::MAX >> 6);
| ~~~
Check warning on line 44 in azalea-buf/src/write.rs
github-actions / clippy
usage of a legacy numeric method
warning: usage of a legacy numeric method
--> azalea-buf/src/write.rs:44:42
|
44 | value = (value >> 7) & (i32::max_value() >> 6);
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
= note: `#[warn(clippy::legacy_numeric_constants)]` on by default
help: use the associated constant instead
|
44 | value = (value >> 7) & (i32::MAX >> 6);
| ~~~