From 252958bb90751b0d278b1a478193b046edcfabe2 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 21 Oct 2023 01:34:18 -0500 Subject: [PATCH] async_fn_in_trait stabilized --- azalea/src/bot.rs | 3 ++- azalea/src/container.rs | 6 +++++- azalea/src/lib.rs | 1 - 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 768ae7675..509d0e2d7 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -21,6 +21,7 @@ use azalea_physics::PhysicsSet; use bevy_app::{FixedUpdate, Update}; use bevy_ecs::prelude::Event; use bevy_ecs::schedule::IntoSystemConfigs; +use futures_lite::Future; use log::trace; use std::f64::consts::PI; @@ -82,7 +83,7 @@ pub trait BotClientExt { /// that's necessary you'll have to do that yourself with [`look_at`]. /// /// [`look_at`]: crate::prelude::BotClientExt::look_at - async fn mine(&mut self, position: BlockPos); + fn mine(&mut self, position: BlockPos) -> impl Future + Send; } impl BotClientExt for azalea_client::Client { diff --git a/azalea/src/container.rs b/azalea/src/container.rs index 34f867154..221b80b96 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -10,6 +10,7 @@ use azalea_inventory::{operations::ClickOperation, ItemSlot, Menu}; use azalea_protocol::packets::game::ClientboundGamePacket; use bevy_app::{App, Plugin, Update}; use bevy_ecs::{component::Component, prelude::EventReader, system::Commands}; +use futures_lite::Future; use std::fmt::Debug; use crate::bot::BotClientExt; @@ -22,7 +23,10 @@ impl Plugin for ContainerPlugin { } pub trait ContainerClientExt { - async fn open_container(&mut self, pos: BlockPos) -> Option; + fn open_container( + &mut self, + pos: BlockPos, + ) -> impl Future> + Send; fn open_inventory(&mut self) -> Option; } diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index c788434b9..bfa38fdad 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -1,7 +1,6 @@ #![doc = include_str!("../README.md")] #![feature(async_closure)] #![allow(incomplete_features)] -#![feature(async_fn_in_trait)] #![feature(type_changing_struct_update)] #![feature(lazy_cell)] #![feature(let_chains)]