Answers for "rust vector sort"

1

rust sort

fn main() {
    let mut vec = vec![1, 5, 10, 2, 15];    
    vec.sort();
}
Posted by: Guest on January-04-2021
0

sort a vector rust

fn main() {
    let mut vec = vec![1, 5, 10, 2, 15];
    
    vec.sort();

    assert_eq!(vec, vec![1, 2, 5, 10, 15]);
}
Running...
Posted by: Guest on October-14-2021

Browse Popular Code Answers by Language