On Tue, Feb 25, 2014 at 11:00 AM, Phil Dawes <[email protected]> wrote:
> fn main() {
> let arr : ~[&str] = std::os::args()[1].split_str("::").collect();
> std::io::println("first " + arr[0]);
> std::io::println("first again " + arr[0]);
> }
>
I am working on an older version of the compiler that fails to compile this
code, giving an error about the reference to the return value of
std::os::args() not being valid for the duration of its use.
Does
let args = std::os::args();
let arr : ~[&str] = args[1].split_str("::").collect();
work properly?
Ashish
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev