Answers for "vector sort rust"

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