Hi
I was wondering
For example:
fn main() {
let mut x = "bad cab".chars().collect::<Vec<char>>();
x.sort();
println!("{}", x.into_iter().collect::<String>());
} // prints " aabbcd"
you can do this:
import algorithm # algorithm contains the sort function
var x = "bad cab" # `var` is for mutable
x.sort(cmp) # default comparison function `cmp` from system
echo x # prints " aabbcd"
Well there is not really an equivalent to collect. Ther is toSeq but that only allows collecting into a seq type.