Skip to content

Commit 152f91d

Browse files
committed
Appease clippy.
1 parent 70b9d7a commit 152f91d

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/bindgen/bindings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ impl Bindings {
143143
std::fs::create_dir_all(dir).unwrap();
144144
}
145145
let mut writer = BufWriter::new(File::create(symfile_path).unwrap());
146-
write!(&mut writer, "{{\n").expect("writing symbol file header failed");
146+
writeln!(&mut writer, "{{").expect("writing symbol file header failed");
147147
for symbol in self.dynamic_symbols_names() {
148-
write!(&mut writer, "{};\n", symbol).expect("writing symbol failed");
148+
writeln!(&mut writer, "{};", symbol).expect("writing symbol failed");
149149
}
150150
write!(&mut writer, "}};").expect("writing symbol file footer failed");
151151
}

src/bindgen/cdecl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,7 @@ impl CDecl {
236236

237237
#[allow(clippy::while_let_on_iterator)]
238238
while let Some(declarator) = iter_rev.next() {
239-
let next_is_pointer = iter_rev.peek().map_or(false, |x| x.is_ptr());
240-
239+
let next_is_pointer = iter_rev.peek().is_some_and(|x| x.is_ptr());
241240
match *declarator {
242241
CDeclarator::Ptr {
243242
is_const,

src/bindgen/ir/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl Constant {
645645
return;
646646
}
647647

648-
let associated_to_transparent = associated_to_struct.map_or(false, |s| s.is_transparent);
648+
let associated_to_transparent = associated_to_struct.is_some_and(|s| s.is_transparent);
649649

650650
let in_body = associated_to_struct.is_some()
651651
&& config.language == Language::Cxx

0 commit comments

Comments
 (0)