- sort
Sort vector of numbers
examples/vectors/sort-vector/src/main.rs
fn main() { let mut numbers = vec![10, 12, 11]; println!("{:?}", numbers); numbers.sort(); println!("{:?}", numbers); }
[10, 12, 11] [10, 11, 12]
fn main() { let mut numbers = vec![10, 12, 11]; println!("{:?}", numbers); numbers.sort(); println!("{:?}", numbers); }
[10, 12, 11] [10, 11, 12]