diff rust/hg-core/src/dagops.rs @ 49930:e98fd81bb151

rust-clippy: fix most warnings in `hg-core` All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent. The remaining warnings have to be fixed either with a bigger refactor like for the nested "revlog" module, or in the dependency `bytes-cast`, which we own. This will be done sometime in the future.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 19:18:43 +0100
parents 26114bd6ec60
children 4c5f6e95df84
line wrap: on
line diff
--- a/rust/hg-core/src/dagops.rs	Mon Jan 09 19:14:14 2023 +0100
+++ b/rust/hg-core/src/dagops.rs	Mon Jan 09 19:18:43 2023 +0100
@@ -181,7 +181,7 @@
         let mut revs: HashSet<Revision> = revs.iter().cloned().collect();
         retain_heads(graph, &mut revs)?;
         let mut as_vec: Vec<Revision> = revs.iter().cloned().collect();
-        as_vec.sort();
+        as_vec.sort_unstable();
         Ok(as_vec)
     }
 
@@ -206,7 +206,7 @@
     ) -> Result<Vec<Revision>, GraphError> {
         let heads = heads(graph, revs.iter())?;
         let mut as_vec: Vec<Revision> = heads.iter().cloned().collect();
-        as_vec.sort();
+        as_vec.sort_unstable();
         Ok(as_vec)
     }
 
@@ -231,7 +231,7 @@
     ) -> Result<Vec<Revision>, GraphError> {
         let set: HashSet<_> = revs.iter().cloned().collect();
         let mut as_vec = roots(graph, &set)?;
-        as_vec.sort();
+        as_vec.sort_unstable();
         Ok(as_vec)
     }