I'm trying to define a trait that extends IntoIterator, to achieve something similar to the code bellow, but "associated type defaults are unstable" (https://github.com/rust-lang/rust/issues/29661).
Is there another way to achieve it?
pub trait MyTrait : IntoIterator{
type Item = i32;
fn foo(&self);
}
pub fn run<M: MyTrait>(my : M){
my.foo();
for a in my {
println!("{}", a);
}
}