Created
January 27, 2018 19:15
-
-
Save boo1ean/4914cbc0ce6d3f385de33266dd2398f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn sort(list: &mut [i32]) -> &mut [i32] { | |
list[0] = list[1]; | |
list | |
} | |
fn main() { | |
println!("Hello, world!"); | |
let mut v = vec![1, 2, 3]; | |
let q = sort(&mut v); | |
q[2] = q[1]; | |
println!("{:?}", q); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment