Skip to content

Commit 3b4f6b8

Browse files
committed
Fix flat_map_option lint
1 parent b7c7964 commit 3b4f6b8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ cast_sign_loss = "allow"
6060
checked_conversions = "allow"
6161
default_trait_access = "allow"
6262
explicit_into_iter_loop = "allow"
63-
flat_map_option = "allow"
6463
ignored_unit_patterns = "allow"
6564
implicit_hasher = "allow"
6665
inconsistent_struct_constructor = "allow"

bindgen/codegen/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,12 +2629,9 @@ impl CodeGenerator for CompInfo {
26292629
} else {
26302630
self.fields()
26312631
.iter()
2632-
.filter_map(|field| match *field {
2633-
Field::DataMember(ref f) if f.name().is_some() => Some(f),
2634-
_ => None,
2635-
})
2636-
.flat_map(|field| {
2637-
let name = field.name().unwrap();
2632+
.filter_map(|field| {
2633+
let Field::DataMember(field) = field else { return None };
2634+
let name = field.name()?;
26382635
field.offset().map(|offset| {
26392636
let field_offset = offset / 8;
26402637
let field_name = ctx.rust_ident(name);

0 commit comments

Comments
 (0)