// *** before: ***
// a trait with an async method needed an outside macro,
// and every call needed a box with a future inside
#[async_trait]
trait Storage {
async fn load(&self, id: u32) -> String;
}
// *** in version 1.75: ***
trait Storage {
async fn load(&self, id: u32) -> String;
}
struct Memory;
impl Storage for Memory {
async fn load(&self, id: u32) -> String {
format!("record {id}")
}
}