Skip to content

Commit 8716994

Browse files
authored
Make clippy happy (#2602)
1 parent 6a9a089 commit 8716994

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bindgen/ir/ty.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,10 @@ impl Type {
210210
self.layout.or_else(|| {
211211
match self.kind {
212212
TypeKind::Comp(ref ci) => ci.layout(ctx),
213-
TypeKind::Array(inner, length) if length == 0 => Some(
214-
Layout::new(0, ctx.resolve_type(inner).layout(ctx)?.align),
215-
),
213+
TypeKind::Array(inner, 0) => Some(Layout::new(
214+
0,
215+
ctx.resolve_type(inner).layout(ctx)?.align,
216+
)),
216217
// FIXME(emilio): This is a hack for anonymous union templates.
217218
// Use the actual pointer size!
218219
TypeKind::Pointer(..) => Some(Layout::new(

bindgen/options/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ options! {
11031103
self.options
11041104
.module_lines
11051105
.entry(module.into().into_boxed_str())
1106-
.or_insert_with(Vec::new)
1106+
.or_default()
11071107
.push(line.into().into_boxed_str());
11081108
self
11091109
}

0 commit comments

Comments
 (0)