Skip to content

fix: unwrap no more #52

fix: unwrap no more

fix: unwrap no more #52

GitHub Actions / clippy succeeded May 26, 2024 in 1s

clippy

31 warnings

Details

Results

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

Versions

  • rustc 1.80.0-nightly (1ba35e9bb 2024-05-25)
  • cargo 1.80.0-nightly (a8d72c675 2024-05-24)
  • clippy 0.1.80 (1ba35e9 2024-05-25)

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 8 in azalea-client/src/packet_handling/configuration.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `azalea_protocol::packets::configuration::serverbound_resource_pack_packet::ServerboundResourcePackPacket`

warning: unused import: `azalea_protocol::packets::configuration::serverbound_resource_pack_packet::ServerboundResourcePackPacket`
 --> azalea-client/src/packet_handling/configuration.rs:8:5
  |
8 | use azalea_protocol::packets::configuration::serverbound_resource_pack_packet::ServerboundResourcePackPacket;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` 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 87 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:87:9
   |
82 | pub struct BlockCollisionsState<'a> {
   |            -------------------- field in this struct
...
87 |     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 12 in azalea-protocol/src/read.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `tracing::info`

warning: unused import: `tracing::info`
  --> azalea-protocol/src/read.rs:12:5
   |
12 | use tracing::info;
   |     ^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Check warning on line 68 in azalea-brigadier/src/command_dispatcher.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mutable key type

warning: mutable key type
  --> azalea-brigadier/src/command_dispatcher.rs:68:9
   |
68 |         let mut errors = HashMap::<Rc<CommandNode<S>>, CommandSyntaxException>::new();
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mutable_key_type
   = note: `#[warn(clippy::mutable_key_type)]` on by default

Check warning on line 351 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:351:12
    |
351 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 344 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:344:12
    |
344 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 337 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:337:12
    |
337 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 327 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:327:12
    |
327 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 318 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:318:12
    |
318 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 309 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:309:12
    |
309 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 289 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:289:12
    |
289 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 248 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:248:12
    |
248 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 238 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:238:12
    |
238 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 194 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:194:12
    |
194 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 179 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:179:11
    |
179 | #[cfg(not(feature = "strict_registry"))]
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 144 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:144:7
    |
144 | #[cfg(feature = "strict_registry")]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 133 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:133:12
    |
133 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

Check warning on line 124 in azalea-core/src/registry_holder.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unexpected `cfg` condition value: `strict_registry`

warning: unexpected `cfg` condition value: `strict_registry`
   --> azalea-core/src/registry_holder.rs:124:12
    |
124 | #[cfg_attr(feature = "strict_registry", simdnbt(deny_unknown_fields))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: expected values for `feature` are: `bevy_ecs` and `serde`
    = help: consider adding `strict_registry` as a feature in `Cargo.toml`
    = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration