Skip to content
GitHub Actions / clippy succeeded Jan 10, 2025 in 0s

clippy

31 warnings

Details

Results

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

Versions

  • rustc 1.86.0-nightly (824759493 2025-01-09)
  • cargo 1.86.0-nightly (fd784878c 2025-01-03)
  • clippy 0.1.85 (8247594932 2025-01-09)

Annotations

Check warning on line 859 in azalea-client/src/packet_handling/game.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

using `clone` on type `Position` which implements the `Copy` trait

warning: using `clone` on type `Position` which implements the `Copy` trait
   --> azalea-client/src/packet_handling/game.rs:859:40
    |
859 |                         let position = position.clone();
    |                                        ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*position`
    |
    = 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

Check warning on line 289 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you seem to be trying to use `match` for an equality check. Consider using `if`

warning: you seem to be trying to use `match` for an equality check. Consider using `if`
   --> azalea-physics/src/lib.rs:261:5
    |
261 | /     match registry_block {
262 | |         azalea_registry::Block::BubbleColumn => {
263 | |             let block_above = world.get_block_state(&block_pos.up(1)).unwrap_or_default();
264 | |             let is_block_above_empty =
...   |
288 | |         _ => {}
289 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
    = note: `#[warn(clippy::single_match)]` on by default
help: try
    |
261 ~     if registry_block == azalea_registry::Block::BubbleColumn {
262 +         let block_above = world.get_block_state(&block_pos.up(1)).unwrap_or_default();
263 +         let is_block_above_empty =
264 +             block_above.is_collision_shape_empty() && FluidState::from(block_above).is_empty();
265 +         let drag_down = block
266 +             .property::<properties::Drag>()
267 +             .expect("drag property should always be present on bubble columns");
268 +         let velocity = &mut physics.velocity;
269 + 
270 +         if is_block_above_empty {
271 +             let new_y = if drag_down {
272 +                 f64::max(-0.9, velocity.y - 0.03)
273 +             } else {
274 +                 f64::min(1.8, velocity.y + 0.1)
275 +             };
276 +             velocity.y = new_y;
277 +         } else {
278 +             let new_y = if drag_down {
279 +                 f64::max(-0.3, velocity.y - 0.03)
280 +             } else {
281 +                 f64::min(0.7, velocity.y + 0.06)
282 +             };
283 +             velocity.y = new_y;
284 +             physics.reset_fall_distance();
285 +         }
286 +     }
    |

Check warning on line 166 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calls to `push` immediately after creation

warning: calls to `push` immediately after creation
   --> azalea-physics/src/lib.rs:162:9
    |
162 | /         let mut movement_this_tick = Vec::<EntityMovement>::new();
163 | |         movement_this_tick.push(EntityMovement {
164 | |             from: physics.old_position,
165 | |             to: **position,
166 | |         });
    | |___________^ help: consider using the `vec![]` macro: `let movement_this_tick = vec![..];`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
    = note: `#[warn(clippy::vec_init_then_push)]` on by default

Check warning on line 131 in azalea-physics/src/lib.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-physics/src/lib.rs:117:16
    |
117 |       mut query: Query<
    |  ________________^
118 | |         (
119 | |             &mut Physics,
120 | |             &mut LookDirection,
...   |
130 | |         (With<LocalEntity>, With<InLoadedChunk>),
131 | |     >,
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity

Check warning on line 259 in azalea-physics/src/travel.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

warning: unneeded late initialization
   --> azalea-physics/src/travel.rs:259:9
    |
259 |         let new_y_velocity;
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = 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 `new_y_velocity` here and remove the assignments from the branches
    |
259 ~         
260 ~         let new_y_velocity = if moving_down
261 |             && (new_velocity.y - 0.005).abs() >= 0.003
262 |             && f64::abs(new_velocity.y - gravity / 16.0) < 0.003
263 |         {
264 ~             -0.003
265 |         } else {
266 ~             new_velocity.y - gravity / 16.0
267 ~         };
    |

Check warning on line 121 in azalea-physics/src/travel.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/travel.rs:121:24
    |
121 |             direction: &direction,
    |                        ^^^^^^^^^^ help: change this to: `direction`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 97 in azalea-physics/src/travel.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (9/7)

warning: this function has too many arguments (9/7)
  --> azalea-physics/src/travel.rs:87:1
   |
87 | / fn travel_in_air(
88 | |     physics: &mut Physics,
89 | |     direction: &LookDirection,
90 | |     position: Mut<Position>,
...  |
96 | |     world: &Instance,
97 | | ) {
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
   = note: `#[warn(clippy::too_many_arguments)]` on by default

Check warning on line 79 in azalea-physics/src/travel.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/travel.rs:79:17
   |
79 |                 &jumping,
   |                 ^^^^^^^^ help: change this to: `jumping`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 77 in azalea-physics/src/travel.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/travel.rs:77:17
   |
77 |                 &on_climbable,
   |                 ^^^^^^^^^^^^^ help: change this to: `on_climbable`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 75 in azalea-physics/src/travel.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/travel.rs:75:17
   |
75 |                 &attributes,
   |                 ^^^^^^^^^^^ help: change this to: `attributes`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 32 in azalea-physics/src/fluids.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/fluids.rs:32:82
   |
32 |         update_in_water_state_and_do_water_current_pushing(&mut physics, &world, &position);
   |                                                                                  ^^^^^^^^^ help: change this to: `position`
   |
   = 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 20 in azalea-physics/src/fluids.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-physics/src/fluids.rs:17:16
   |
17 |       mut query: Query<
   |  ________________^
18 | |         (&mut Physics, &Position, &InstanceName),
19 | |         (With<LocalEntity>, With<InLoadedChunk>),
20 | |     >,
   | |_____^
   |
   = 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 138 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> azalea-physics/src/lib.rs:138:9
    |
138 |         mut last_sent_position,
    |         ----^^^^^^^^^^^^^^^^^^
    |         |
    |         help: remove this `mut`

Check warning on line 137 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> azalea-physics/src/lib.rs:137:9
    |
137 |         mut position,
    |         ----^^^^^^^^
    |         |
    |         help: remove this `mut`

Check warning on line 136 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> azalea-physics/src/lib.rs:136:9
    |
136 |         mut look_direction,
    |         ----^^^^^^^^^^^^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

Check warning on line 144 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `jumping`

warning: unused variable: `jumping`
   --> azalea-physics/src/lib.rs:144:9
    |
144 |         jumping,
    |         ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_jumping`

Check warning on line 143 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `on_climbable`

warning: unused variable: `on_climbable`
   --> azalea-physics/src/lib.rs:143:9
    |
143 |         on_climbable,
    |         ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_on_climbable`

Check warning on line 141 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `attributes`

warning: unused variable: `attributes`
   --> azalea-physics/src/lib.rs:141:9
    |
141 |         attributes,
    |         ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_attributes`

Check warning on line 140 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `pose`

warning: unused variable: `pose`
   --> azalea-physics/src/lib.rs:140:9
    |
140 |         pose,
    |         ^^^^ help: if this is intentional, prefix it with an underscore: `_pose`

Check warning on line 139 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `sprinting`

warning: unused variable: `sprinting`
   --> azalea-physics/src/lib.rs:139:9
    |
139 |         sprinting,
    |         ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sprinting`

Check warning on line 138 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `last_sent_position`

warning: unused variable: `last_sent_position`
   --> azalea-physics/src/lib.rs:138:13
    |
138 |         mut last_sent_position,
    |             ^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_last_sent_position`

Check warning on line 136 in azalea-physics/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `look_direction`

warning: unused variable: `look_direction`
   --> azalea-physics/src/lib.rs:136:13
    |
136 |         mut look_direction,
    |             ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_look_direction`

Check warning on line 251 in azalea-physics/src/fluids.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `direction`

warning: unused variable: `direction`
   --> azalea-physics/src/fluids.rs:251:5
    |
251 |     direction: Direction,
    |     ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_direction`

Check warning on line 250 in azalea-physics/src/fluids.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `pos`

warning: unused variable: `pos`
   --> azalea-physics/src/fluids.rs:250:5
    |
250 |     pos: BlockPos,
    |     ^^^ help: if this is intentional, prefix it with an underscore: `_pos`

Check warning on line 249 in azalea-physics/src/fluids.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `world`

warning: unused variable: `world`
   --> azalea-physics/src/fluids.rs:249:5
    |
249 |     world: &Instance,
    |     ^^^^^ help: if this is intentional, prefix it with an underscore: `_world`