Ignore async fn trait warning

This commit is contained in:
Jackson Coxson
2025-08-11 13:59:06 -06:00
parent c80512f37f
commit d4fa2b6032

View File

@@ -63,6 +63,12 @@ pub trait IdeviceService: Sized {
/// ///
/// # Arguments /// # Arguments
/// * `provider` - The device provider that can supply connections /// * `provider` - The device provider that can supply connections
///
// From the docs
// │ │ ├╴ use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
// │ │ │ 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`
// │ │ │ `#[warn(async_fn_in_trait)]` on by default rustc (async_fn_in_trait) [66, 5]
#[allow(async_fn_in_trait)]
async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError> { async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError> {
let mut lockdown = LockdownClient::connect(provider).await?; let mut lockdown = LockdownClient::connect(provider).await?;
lockdown lockdown
@@ -81,6 +87,7 @@ pub trait IdeviceService: Sized {
Self::from_stream(idevice).await Self::from_stream(idevice).await
} }
#[allow(async_fn_in_trait)]
async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>; async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>;
} }