Skip to content

Adding build mode for structures #509

Adding build mode for structures

Adding build mode for structures #509

GitHub Actions / clippy failed Oct 26, 2023 in 0s

clippy

1 error

Details

Results

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

Versions

  • rustc 1.75.0-nightly (df871fbf0 2023-10-24)
  • cargo 1.75.0-nightly (d2f6a0485 2023-10-20)
  • clippy 0.1.75 (df871fb 2023-10-24)

Annotations

Check failure on line 38 in cosmos_client/src/structure/ship/build_mode.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if` statement can be collapsed

error: this `if` statement can be collapsed
  --> cosmos_client/src/structure/ship/build_mode.rs:31:5
   |
31 | /     if local_player_in_build_mode.get_single().is_ok() {
32 | |         if input_handler.check_just_pressed(CosmosInputs::ToggleBuildMode) {
33 | |             client.send_message(
34 | |                 NettyChannelClient::Reliable,
...  |
37 | |         }
38 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
   = note: `-D clippy::collapsible-if` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::collapsible_if)]`
help: collapse nested if block
   |
31 ~     if local_player_in_build_mode.get_single().is_ok() && input_handler.check_just_pressed(CosmosInputs::ToggleBuildMode) {
32 +         client.send_message(
33 +             NettyChannelClient::Reliable,
34 +             cosmos_encoder::serialize(&ClientReliableMessages::ExitBuildMode),
35 +         );
36 +     }
   |