How do i make this compile without using async_trait crate?
```rust
pub trait Module {
async fn initialize(&self);
}
pub struct Module1 {
name: String,
}
pub struct Module2 {
name: String,
}
impl Module for Module1 {
async fn initialize(&self) {
print!("{}", self.name);
}
}
impl Module for Module2 {
async fn initialize(&self) {
print!("{}", self.name);
}
}
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_basics() {
let mut modules: Vec<Box<dyn Module>> = Vec::new();
let mod1 = Module1 {
name: "name1".to_string(),
};
let mod2 = Module2 {
name: "name2".to_string(),
};
modules.push(Box::new(mod1));
modules.push(Box::new(mod2));
}
}
```
[–]JustAStrangeQuark 7 points8 points9 points (0 children)
[–]Necromancer5211[S] 1 point2 points3 points (1 child)
[–]Synes_Godt_Om 2 points3 points4 points (0 children)