fix COST_HEURISTIC #1647
clippy
9 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 9 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.76.0-nightly (eeff92ad3 2023-12-13)
- cargo 1.76.0-nightly (1aa9df1a5 2023-12-12)
- clippy 0.1.76 (eeff92a 2023-12-13)
Annotations
Check warning on line 674 in azalea/src/pathfinder/mod.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
--> azalea/src/pathfinder/mod.rs:666:16
|
666 | mut query: Query<(
| ________________^
667 | | Entity,
668 | | &mut ExecutingPath,
669 | | &Position,
... |
673 | | &InventoryComponent,
674 | | )>,
| |______^
|
= 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 349 in azalea/src/pathfinder/world.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
--> azalea/src/pathfinder/world.rs:349:21
|
345 | / let block_state = BlockState::try_from(
346 | | section.get_at_index(u16::from(ChunkSectionBlockPos::from(pos)) as usize),
347 | | )
348 | | .unwrap_or_default();
| |_________________________________________- unnecessary `let` binding
349 | block_state
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
= note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
|
345 ~
346 ~ BlockState::try_from(
347 + section.get_at_index(u16::from(ChunkSectionBlockPos::from(pos)) as usize),
348 + )
349 + .unwrap_or_default()
|
Check warning on line 352 in azalea/src/pathfinder/world.rs
github-actions / clippy
useless conversion to the same type: `azalea_block::BlockState`
warning: useless conversion to the same type: `azalea_block::BlockState`
--> azalea/src/pathfinder/world.rs:343:31
|
343 | let block_state = BlockState::try_from(
| _______________________________^
344 | | self.with_section(ChunkSectionPos::from(pos), |section| {
345 | | let block_state = BlockState::try_from(
346 | | section.get_at_index(u16::from(ChunkSectionBlockPos::from(pos)) as usize),
... |
351 | | .unwrap_or_default(),
352 | | )
| |_____________^
|
= help: consider removing `BlockState::try_from()`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
Check warning on line 384 in azalea/src/pathfinder/world.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> azalea/src/pathfinder/world.rs:380:9
|
380 | / if !west_is_in_same_section {
381 | | if check_should_avoid_this_block(pos.west(1), &|b| mining_cache.is_liquid(b)) {
382 | | return f32::INFINITY;
383 | | }
384 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
380 ~ if !west_is_in_same_section && check_should_avoid_this_block(pos.west(1), &|b| mining_cache.is_liquid(b)) {
381 + return f32::INFINITY;
382 + }
|
Check warning on line 379 in azalea/src/pathfinder/world.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> azalea/src/pathfinder/world.rs:375:9
|
375 | / if !south_is_in_same_section {
376 | | if check_should_avoid_this_block(pos.south(1), &|b| mining_cache.is_liquid(b)) {
377 | | return f32::INFINITY;
378 | | }
379 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
375 ~ if !south_is_in_same_section && check_should_avoid_this_block(pos.south(1), &|b| mining_cache.is_liquid(b)) {
376 + return f32::INFINITY;
377 + }
|
Check warning on line 374 in azalea/src/pathfinder/world.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> azalea/src/pathfinder/world.rs:370:9
|
370 | / if !east_is_in_same_section {
371 | | if check_should_avoid_this_block(pos.east(1), &|b| mining_cache.is_liquid(b)) {
372 | | return f32::INFINITY;
373 | | }
374 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
370 ~ if !east_is_in_same_section && check_should_avoid_this_block(pos.east(1), &|b| mining_cache.is_liquid(b)) {
371 + return f32::INFINITY;
372 + }
|
Check warning on line 369 in azalea/src/pathfinder/world.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> azalea/src/pathfinder/world.rs:365:9
|
365 | / if !north_is_in_same_section {
366 | | if check_should_avoid_this_block(pos.north(1), &|b| mining_cache.is_liquid(b)) {
367 | | return f32::INFINITY;
368 | | }
369 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
|
365 ~ if !north_is_in_same_section && check_should_avoid_this_block(pos.north(1), &|b| mining_cache.is_liquid(b)) {
366 + return f32::INFINITY;
367 + }
|
Check warning on line 364 in azalea/src/pathfinder/world.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> azalea/src/pathfinder/world.rs:358:9
|
358 | / if !up_is_in_same_section {
359 | | if check_should_avoid_this_block(pos.up(1), &|b| {
360 | | mining_cache.is_liquid(b) || mining_cache.is_falling_block(b)
361 | | }) {
362 | | return f32::INFINITY;
363 | | }
364 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
358 ~ if !up_is_in_same_section && check_should_avoid_this_block(pos.up(1), &|b| {
359 + mining_cache.is_liquid(b) || mining_cache.is_falling_block(b)
360 + }) {
361 + return f32::INFINITY;
362 + }
|
Check warning on line 297 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:297:25
|
297 | #[allow(clippy::vtable_address_comparisons)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `ambiguous_wide_pointer_comparisons`
|
= note: `#[warn(renamed_and_removed_lints)]` on by default