1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

clippy and fix broken doc tests

This commit is contained in:
mat 2025-04-16 07:13:09 +04:00
parent a9820dfd79
commit 66174fc7d4
3 changed files with 9 additions and 5 deletions

View file

@ -1,7 +1,7 @@
use std::{
cmp::Ordering,
collections::{HashMap, HashSet},
mem,
mem, ptr,
rc::Rc,
sync::Arc,
};
@ -349,7 +349,7 @@ impl<S> CommandDispatcher<S> {
}
match &node.redirect {
Some(redirect) => {
let redirect = if redirect.data_ptr() == self.root.data_ptr() {
let redirect = if ptr::eq(redirect.data_ptr(), self.root.data_ptr()) {
"...".to_string()
} else {
format!("-> {}", redirect.read().usage_text())
@ -427,7 +427,7 @@ impl<S> CommandDispatcher<S> {
}
if let Some(redirect) = &node.redirect {
let redirect = if redirect.data_ptr() == self.root.data_ptr() {
let redirect = if ptr::eq(redirect.data_ptr(), self.root.data_ptr()) {
"...".to_string()
} else {
format!("-> {}", redirect.read().usage_text())

View file

@ -10,7 +10,7 @@ use tokio::sync::broadcast;
/// This is useful for running code every schedule from async user code.
///
/// ```
/// use azalea_client::TickBroadcast;
/// use azalea_client::tick_broadcast::TickBroadcast;
/// # async fn example(client: azalea_client::Client) {
/// let mut receiver = {
/// let ecs = client.ecs.lock();
@ -24,6 +24,10 @@ use tokio::sync::broadcast;
/// ```
#[derive(Resource, Deref)]
pub struct TickBroadcast(broadcast::Sender<()>);
/// A resource that contains a [`broadcast::Sender`] that will be sent every
/// Azalea ECS Update.
///
/// Also see [`TickBroadcast`].
#[derive(Resource, Deref)]
pub struct UpdateBroadcast(broadcast::Sender<()>);

View file

@ -195,7 +195,7 @@ impl PathfinderClientExt for azalea_client::Client {
/// ```
/// # use azalea::prelude::*;
/// # use azalea::{BlockPos, pathfinder::goals::BlockPosGoal};
/// # fn example(bot: &Client) {
/// # async fn example(bot: &Client) {
/// bot.goto(BlockPosGoal(BlockPos::new(0, 70, 0))).await;
/// # }
/// ```