Skip to contentSlop Block

no-async-fn-in-traits

Warning

Trait methods return impl Future<Output = T>. Implementations may use async fn.

pub trait UserRepository {	async fn find_by_id(executor: E, id: &UserID) -> Result<Option<Self>>;Declare this trait method as fn ... -> impl Future<Output = T>}
// ast-grep-ignore: no-async-fn-in-traits-rust

How to fix

Add + Send when callers need it. Implementations can still use async fn.