How can a struct
implement a trait method but also call the default version of that method?
pub trait MyTrait {
fn do_it(&self) {
println!("I am doing it the default way.");
}
}
pub struct MyStruct;
impl MyTrait for MyStruct {
fn do_it(&self) {
println!("Doing it my way.");
//Call default method
self.MyTrait::do_it(); //Not worky
}
}
fn main() {
let m = MyStruct;
m.do_it();
}