Sort stability: Difference between revisions

m
→‎{{header|Rust}}: Applied rustfmt, updated trim_right_matches to trim_end_matches
m (→‎{{header|Rust}}: Applied rustfmt, updated trim_right_matches to trim_end_matches)
Line 1,209:
 
<lang rust>fn main() {
let country_city = [("UK", "London"),
("USUK", "New YorkLondon"),
("US", "BirminghamNew York"),
("UKUS", "Birmingham")];,
("UK", "Birmingham"),
];
 
let mut city_sorted = country_city.clone();
Line 1,219 ⟶ 1,221:
let mut country_sorted = country_city.clone();
country_sorted.sort_by_key(|k| k.0);
 
 
println!("Original:");
9,659

edits