Skip to content

fix: useless mut

fix: useless mut #47

GitHub Actions / clippy succeeded Apr 10, 2024 in 0s

clippy

13 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 13
Note 0
Help 0

Versions

  • rustc 1.79.0-nightly (8b2459c1f 2024-04-09)
  • cargo 1.79.0-nightly (28e7b2bc0 2024-04-05)
  • clippy 0.1.79 (8b2459c 2024-04-09)

Annotations

Check warning on line 639 in azalea/src/swarm/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for cloning elements

warning: you are using an explicit closure for cloning elements
   --> azalea/src/swarm/mod.rs:639:25
    |
639 |             let proxy = self.proxies.choose(&mut thread_rng()).map(|p| p.clone());
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.proxies.choose(&mut thread_rng()).cloned()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
    = note: `#[warn(clippy::map_clone)]` on by default

Check warning on line 80 in azalea-client/src/task_pool.rs

See this annotation in the file changed.

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

See this annotation in the file changed.

@github-actions 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 560 in azalea-client/src/packet_handling/game.rs

See this annotation in the file changed.

@github-actions 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/game.rs:560:29
    |
560 | ...                   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 326 in azalea-physics/src/collision/shape.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> azalea-physics/src/collision/shape.rs:326:49
    |
326 |             IndexMerger::new_indirect(&coords1, &coords2, var3, var4)
    |                                                 ^^^^^^^^ help: change this to: `coords2`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 326 in azalea-physics/src/collision/shape.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> azalea-physics/src/collision/shape.rs:326:39
    |
326 |             IndexMerger::new_indirect(&coords1, &coords2, var3, var4)
    |                                       ^^^^^^^^ help: change this to: `coords1`
    |
    = 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

Check warning on line 84 in azalea-physics/src/collision/world_collisions.rs

See this annotation in the file changed.

@github-actions 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:84:9
   |
79 | pub struct BlockCollisionsState<'a> {
   |            -------------------- field in this struct
...
84 |     pub only_suffocating_blocks: bool,
   |         ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 284 in azalea-protocol/src/connect.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

manual implementation of `Option::map`

warning: manual implementation of `Option::map`
   --> azalea-protocol/src/connect.rs:281:28
    |
281 |                   let auth = match proxy.auth {
    |  ____________________________^
282 | |                     Some(user_key) => Some(user_key),
283 | |                     None => None,
284 | |                 };
    | |_________________^ help: try: `proxy.auth.map(|user_key| user_key)`
    |
    = 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 284 in azalea-protocol/src/connect.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this match expression is unnecessary

warning: this match expression is unnecessary
   --> azalea-protocol/src/connect.rs:281:28
    |
281 |                   let auth = match proxy.auth {
    |  ____________________________^
282 | |                     Some(user_key) => Some(user_key),
283 | |                     None => None,
284 | |                 };
    | |_________________^ help: replace it with: `proxy.auth`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match
    = note: `#[warn(clippy::needless_match)]` on by default

Check warning on line 83 in azalea-brigadier/src/context/command_context_builder.rs

See this annotation in the file changed.

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

See this annotation in the file changed.

@github-actions 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 140 in azalea-buf/src/write.rs

See this annotation in the file changed.

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

See this annotation in the file changed.

@github-actions 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);
   |                                          ~~~