Skip to content

fix QueryDoesNotMatch and improve error #1469

fix QueryDoesNotMatch and improve error

fix QueryDoesNotMatch and improve error #1469

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / clippy succeeded Oct 6, 2023 in 0s

clippy

4 warnings

Details

Results

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

Versions

  • rustc 1.75.0-nightly (cae0791da 2023-10-05)
  • cargo 1.75.0-nightly (794d0a825 2023-10-03)
  • clippy 0.1.74 (cae0791 2023-10-05)

Annotations

Check warning on line 25 in azalea/src/container.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified

warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
  --> azalea/src/container.rs:25:5
   |
25 |     async fn open_container(&mut self, pos: BlockPos) -> Option<ContainerHandle>;
   |     ^^^^^
   |
   = note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
   |
25 -     async fn open_container(&mut self, pos: BlockPos) -> Option<ContainerHandle>;
25 +     fn open_container(&mut self, pos: BlockPos) -> impl std::future::Future<Output = Option<ContainerHandle>> + Send;
   |

Check warning on line 84 in azalea/src/bot.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified

warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
  --> azalea/src/bot.rs:84:5
   |
84 |     async fn mine(&mut self, position: BlockPos);
   |     ^^^^^
   |
   = note: you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
   = note: `#[warn(async_fn_in_trait)]` on by default
help: you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`
   |
84 -     async fn mine(&mut self, position: BlockPos);
84 +     fn mine(&mut self, position: BlockPos) -> impl std::future::Future<Output = ()> + Send;
   |

Check warning on line 73 in azalea-client/src/entity_query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `expect` followed by a function call

warning: use of `expect` followed by a function call
  --> azalea-client/src/entity_query.rs:70:46
   |
70 |           let components = q.get(&ecs, entity).expect(&format!(
   |  ______________________________________________^
71 | |             "Entity is missing a required component {:?}",
72 | |             std::any::type_name::<Q>()
73 | |         ));
   | |__________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
help: try
   |
70 ~         let components = q.get(&ecs, entity).unwrap_or_else(|_| panic!("Entity is missing a required component {:?}",
71 ~             std::any::type_name::<Q>()));
   |

Check warning on line 29 in azalea-client/src/entity_query.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `expect` followed by a function call

warning: use of `expect` followed by a function call
  --> azalea-client/src/entity_query.rs:26:52
   |
26 |           ecs.query::<Q>().get_mut(ecs, self.entity).expect(&format!(
   |  ____________________________________________________^
27 | |             "Our client is missing a required component {:?}",
28 | |             std::any::type_name::<Q>()
29 | |         ))
   | |__________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
   = note: `#[warn(clippy::expect_fun_call)]` on by default
help: try
   |
26 ~         ecs.query::<Q>().get_mut(ecs, self.entity).unwrap_or_else(|_| panic!("Our client is missing a required component {:?}",
27 +             std::any::type_name::<Q>()))
   |