Skip to content

Commit fa874b0

Browse files
compiler-errorsantoyo
authored andcommitted
Simplify some iterator combinators
1 parent 3a1d324 commit fa874b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
13651365
) -> RValue<'gcc> {
13661366
// FIXME(antoyo): remove when having a proper API.
13671367
let gcc_func = unsafe { std::mem::transmute(func) };
1368-
let call = if self.functions.borrow().values().find(|value| **value == gcc_func).is_some() {
1368+
let call = if self.functions.borrow().values().any(|value| *value == gcc_func) {
13691369
self.function_call(func, args, funclet)
13701370
}
13711371
else {

src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
258258

259259
pub fn rvalue_as_function(&self, value: RValue<'gcc>) -> Function<'gcc> {
260260
let function: Function<'gcc> = unsafe { std::mem::transmute(value) };
261-
debug_assert!(self.functions.borrow().values().find(|value| **value == function).is_some(),
262-
"{:?} is not a function", function);
261+
debug_assert!(self.functions.borrow().values().any(|value| *value == function),
262+
"{:?} ({:?}) is not a function", value, value.get_type());
263263
function
264264
}
265265

0 commit comments

Comments
 (0)