about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-10 20:31:01 +0000
committerAntoni Boucher <bouanto@zoho.com>2023-02-28 22:00:40 -0500
commitfa874b03e43aa4f3e136e1920e6016060418bb9b (patch)
tree6b305cffc0231e5ff941b8078e35d44d89619f8a /src
parent3a1d3241b4f998d136afe188072dc36f006d026c (diff)
downloadrust-fa874b03e43aa4f3e136e1920e6016060418bb9b.tar.gz
rust-fa874b03e43aa4f3e136e1920e6016060418bb9b.zip
Simplify some iterator combinators
Diffstat (limited to 'src')
-rw-r--r--src/builder.rs2
-rw-r--r--src/context.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/builder.rs b/src/builder.rs
index 70a93cb06d1..f3036287152 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -1365,7 +1365,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
     ) -> RValue<'gcc> {
         // FIXME(antoyo): remove when having a proper API.
         let gcc_func = unsafe { std::mem::transmute(func) };
-        let call = if self.functions.borrow().values().find(|value| **value == gcc_func).is_some() {
+        let call = if self.functions.borrow().values().any(|value| *value == gcc_func) {
             self.function_call(func, args, funclet)
         }
         else {
diff --git a/src/context.rs b/src/context.rs
index 6391c4e9d83..9bd3710ac8a 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -258,8 +258,8 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
 
     pub fn rvalue_as_function(&self, value: RValue<'gcc>) -> Function<'gcc> {
         let function: Function<'gcc> = unsafe { std::mem::transmute(value) };
-        debug_assert!(self.functions.borrow().values().find(|value| **value == function).is_some(),
-            "{:?} is not a function", function);
+        debug_assert!(self.functions.borrow().values().any(|value| *value == function),
+            "{:?} ({:?}) is not a function", value, value.get_type());
         function
     }