]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/stable_sort_primitive.rs
Auto merge of #84620 - Dylan-DPC:rollup-wkv97im, r=Dylan-DPC
[rust.git] / src / tools / clippy / tests / ui / stable_sort_primitive.rs
index f9bd977906718156cb1601699e158ca3686cefa9..8149c5638e0f73c2c7766d16c3c880739b7f442c 100644 (file)
@@ -20,7 +20,7 @@ fn main() {
     // Negative examples: behavior changes if made unstable
     let mut vec = vec![1, 3, 2];
     vec.sort_by_key(|i| i / 2);
-    vec.sort_by(|a, b| (a + b).cmp(&b));
+    vec.sort_by(|&a, &b| (a + b).cmp(&b));
     // negative examples - Not of a primitive type
     let mut vec_of_complex = vec![String::from("hello"), String::from("world!")];
     vec_of_complex.sort();