Skip to content

resolve some todos in az-core #526

resolve some todos in az-core

resolve some todos in az-core #526

GitHub Actions / clippy succeeded Dec 27, 2024 in 0s

clippy

15 warnings

Details

Results

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

Versions

  • rustc 1.85.0-nightly (917bfa784 2024-12-26)
  • cargo 1.85.0-nightly (c86f4b3a1 2024-12-24)
  • clippy 0.1.85 (917bfa7847 2024-12-26)

Annotations

Check warning on line 532 in azalea/src/pathfinder/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
   --> azalea/src/pathfinder/mod.rs:524:16
    |
524 |       mut query: Query<(
    |  ________________^
525 | |         Entity,
526 | |         &mut Pathfinder,
527 | |         &mut ExecutingPath,
...   |
531 | |         &Inventory,
532 | |     )>,
    | |______^
    |
    = 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 343 in azalea/src/pathfinder/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

warning: unneeded late initialization
   --> azalea/src/pathfinder/mod.rs:343:5
    |
343 |     let path;
    |     ^^^^^^^^^ created here
...
378 |     path = movements.into_iter().collect::<VecDeque<_>>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here
    |
    = 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: move the declaration `path` here
    |
343 ~     
344 |
...
377 |
378 ~     let path = movements.into_iter().collect::<VecDeque<_>>();
    |

Check warning on line 266 in azalea/src/pathfinder/world.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
   --> azalea/src/pathfinder/world.rs:266:13
    |
266 |             (pos.x as usize & 0xff) << 12 | (pos.y as usize & 0xf) << 8 | (pos.z as usize & 0xff);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `((pos.x as usize & 0xff) << 12) | ((pos.y as usize & 0xf) << 8)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
    = note: `#[warn(clippy::precedence)]` on by default

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

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> azalea-physics/src/collision/shape.rs:416:47
    |
416 |                 binary_search(0, upper_limit, &|t| coord < self.get(axis, t as usize)) - 1
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `|t| coord < self.get(axis, t as usize)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Check warning on line 39 in azalea-protocol/src/packets/game/c_section_blocks_update.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-protocol/src/packets/game/c_section_blocks_update.rs:39:16
   |
39 |             | (u64::from(self.pos.x) << 8 | u64::from(self.pos.z) << 4 | u64::from(self.pos.y));
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(u64::from(self.pos.x) << 8) | (u64::from(self.pos.z) << 4)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 39 in azalea-protocol/src/packets/game/c_section_blocks_update.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-protocol/src/packets/game/c_section_blocks_update.rs:38:20
   |
38 |           let data = (self.state.id as u64) << 12
   |  ____________________^
39 | |             | (u64::from(self.pos.x) << 8 | u64::from(self.pos.z) << 4 | u64::from(self.pos.y));
   | |_______________________________________________________________________________________________^ help: consider parenthesizing your expression: `((self.state.id as u64) << 12) | (u64::from(self.pos.x) << 8 | u64::from(self.pos.z) << 4 | u64::from(self.pos.y))`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 30 in azalea-protocol/src/packets/game/c_section_blocks_update.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-protocol/src/packets/game/c_section_blocks_update.rs:30:17
   |
30 |             z: (position_part >> 4 & 15) as u8,
   |                 ^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(position_part >> 4) & 15`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 28 in azalea-protocol/src/packets/game/c_section_blocks_update.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-protocol/src/packets/game/c_section_blocks_update.rs:28:17
   |
28 |             x: (position_part >> 8 & 15) as u8,
   |                 ^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(position_part >> 8) & 15`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
   = note: `#[warn(clippy::precedence)]` on by default

Check warning on line 209 in azalea-world/src/bit_storage.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
   --> azalea-world/src/bit_storage.rs:209:17
    |
209 |         *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `*cell & !(self.mask << bit_index) | ((value & self.mask) << bit_index)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 194 in azalea-world/src/bit_storage.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
   --> azalea-world/src/bit_storage.rs:194:17
    |
194 |         *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `*cell & !(self.mask << bit_index) | ((value & self.mask) << bit_index)`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 193 in azalea-world/src/bit_storage.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
   --> azalea-world/src/bit_storage.rs:193:25
    |
193 |         let old_value = *cell >> (bit_index as u64) & self.mask;
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(*cell >> (bit_index as u64)) & self.mask`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 179 in azalea-world/src/bit_storage.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
   --> azalea-world/src/bit_storage.rs:179:9
    |
179 |         cell >> bit_index & self.mask
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(cell >> bit_index) & self.mask`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
    = note: `#[warn(clippy::precedence)]` on by default

Check warning on line 36 in azalea-core/src/color.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-core/src/color.rs:36:20
   |
36 |             value: (a as u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | b as u32,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `((a as u32) << 24) | ((r as u32) << 16)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 36 in azalea-core/src/color.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-core/src/color.rs:36:20
   |
36 |             value: (a as u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | b as u32,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(a as u32) << 24 | (r as u32) << 16 | ((g as u32) << 8)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence

Check warning on line 11 in azalea-core/src/color.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

operator precedence can trip the unwary

warning: operator precedence can trip the unwary
  --> azalea-core/src/color.rs:11:20
   |
11 |             value: (r as u32) << 16 | (g as u32) << 8 | b as u32,
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `((r as u32) << 16) | ((g as u32) << 8)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence
   = note: `#[warn(clippy::precedence)]` on by default