Hard
A trait with a generic method used behind &dyn
What happens when this program is compiled?
main.rs
trait Converter {
fn convert<T>(&self, value: T) -> String;
}
struct Doubler;
impl Converter for Doubler {
fn convert<T>(&self, value: T) -> String {
format!("converted")
}
}
fn use_converter(c: &dyn Converter) {
let _ = c;
}
fn main() {
let d = Doubler;
use_converter(&d);
}17 of 53 in Rust