summary refs log tree commit diff
path: root/compiler/rustc_monomorphize/src
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-03-07 17:43:42 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-03-07 18:13:41 +0000
commit775bacd1b8d97ade32c8d74ce35be1f34759aead (patch)
tree774e3a2e4f0b44a136fe7e4623d390cc1a688880 /compiler/rustc_monomorphize/src
parentac4379fea9e83465d814bb05005689f49bd2141e (diff)
downloadrust-775bacd1b8d97ade32c8d74ce35be1f34759aead.tar.gz
rust-775bacd1b8d97ade32c8d74ce35be1f34759aead.zip
Simplify `sort_by` calls
Diffstat (limited to 'compiler/rustc_monomorphize/src')
-rw-r--r--compiler/rustc_monomorphize/src/partitioning/merging.rs2
-rw-r--r--compiler/rustc_monomorphize/src/partitioning/mod.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_monomorphize/src/partitioning/merging.rs b/compiler/rustc_monomorphize/src/partitioning/merging.rs
index 02bb8dea0c0..5c524a18454 100644
--- a/compiler/rustc_monomorphize/src/partitioning/merging.rs
+++ b/compiler/rustc_monomorphize/src/partitioning/merging.rs
@@ -24,7 +24,7 @@ pub fn merge_codegen_units<'tcx>(
     // smallest into each other) we're sure to start off with a deterministic
     // order (sorted by name). This'll mean that if two cgus have the same size
     // the stable sort below will keep everything nice and deterministic.
-    codegen_units.sort_by(|a, b| a.name().as_str().partial_cmp(b.name().as_str()).unwrap());
+    codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str()));
 
     // This map keeps track of what got merged into what.
     let mut cgu_contents: FxHashMap<Symbol, Vec<Symbol>> =
diff --git a/compiler/rustc_monomorphize/src/partitioning/mod.rs b/compiler/rustc_monomorphize/src/partitioning/mod.rs
index 524c51d88d7..7ac1c9e057e 100644
--- a/compiler/rustc_monomorphize/src/partitioning/mod.rs
+++ b/compiler/rustc_monomorphize/src/partitioning/mod.rs
@@ -252,7 +252,7 @@ pub fn partition<'tcx>(
         internalization_candidates: _,
     } = post_inlining;
 
-    result.sort_by(|a, b| a.name().as_str().partial_cmp(b.name().as_str()).unwrap());
+    result.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str()));
 
     result
 }