Skip to content

Commit 26c010c

Browse files
Simplify some iterator combinators
1 parent 2d09c9b commit 26c010c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/builder.rs

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

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
253253

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

0 commit comments

Comments
 (0)