Skip to content

Commit 3f23f5b

Browse files
committed
build: Remove manual implementation of find() as suggested by clippy
https://rust-lang.github.io/rust-clippy/master/index.html#manual_find Signed-off-by: Akira Moroo <retrage01@gmail.com>
1 parent 3ccd277 commit 3f23f5b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/efi/var.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@ impl VariableAllocator {
5252
let mut name: Vec<u16> = Vec::new();
5353
name.extend_from_slice(s);
5454
let guid = unsafe { &*guid };
55-
for i in 0..self.allocations.len() {
56-
if name == self.allocations[i].name && guid == &self.allocations[i].guid {
57-
return Some(i);
58-
}
59-
}
60-
None
55+
(0..self.allocations.len())
56+
.find(|&i| name == self.allocations[i].name && guid == &self.allocations[i].guid)
6157
}
6258

6359
pub fn get(

0 commit comments

Comments
 (0)