Hi, i am not aware of why similar implementations of to_str() for
~[mut T] and @[mut T] are missing and core lib, so i am suggesting to
add them as follows (in rather naive manner, so any change should be
an improvement):

-->8--
import io::*;
import to_str::*;

impl <T : to_str> of to_str for @[mut T] {
    fn to_str() -> ~str {
        (@self).map(|x| { x.to_str() }).to_str()
    }
}

impl <T : to_str copy> of to_str for ~[mut T] {
    fn to_str() -> ~str {
        (~copy self).map(|x| { x.to_str() }).to_str()
    }
}

fn main() {
    println((~[mut 1, 2, 3]).to_str());
    println((@[mut 1, 2, 3]).to_str());
}
-->8--

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

Reply via email to