Thanks for your help. I'll test ASAP.
I use the counter mutable var to have a simple implantation of the iterator to make the code works. Thank for you're example to show a better way. I was thinking of a similar way but I would like to avoid the specific struct with perhaps use a recursive call. I'll think about it later.

Le 07/04/2014 10:27, Rodrigo Rivas a écrit :
BTW, why all the double pointer in all the "&mut ~Base" instead of
just "&mut Base"?
For your question, I have &mut ~Base because i didn't find a way to convert the &mut ~Base to &mut Base (or &~Base to &Base) without copy. I have the error error: mismatched types: expected `std::option::Option<&'a mut ~Base<no-bounds>>` but found `std::option::Option<&mut &~Base<no-bounds>>` I try & (error above), &* error type `~Base<no-bounds>` cannot be dereferenced. So I stop searching and try to make it works with ~Base. The callback function is modifying the Vec instance. It's a method that update all the of the Vec element after an event occurs. I have to keep the reference to the Vec instance during the call. Perhaps there's a conception problem that I'll look later to remove most of the mut call but I try this type of call to learn who Rust works.

Perhaps you can help me for this part.

Philippe

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to