Skip to content

Commit b0f010f

Browse files
committed
Resolve collapsible_match clippy lint
warning: this `if let` can be collapsed into the outer `if let` --> gen/src/write.rs:1117:13 | 1117 | / if let Type::RustBox(_) | Type::UniquePtr(_) | Type::Str(_) | Type::SliceRef(_) = ret { 1118 | | write!(out, ")"); 1119 | | } | |_____________^ | help: the outer pattern can be modified to include the inner pattern --> gen/src/write.rs:1116:21 | 1116 | if let Some(ret) = &sig.ret { | ^^^ replace this binding 1117 | if let Type::RustBox(_) | Type::UniquePtr(_) | Type::Str(_) | Type::SliceRef(_) = ret { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match = note: `#[warn(clippy::collapsible_match)]` on by default
1 parent d5dd976 commit b0f010f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gen/src/write.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,10 +1113,10 @@ fn write_rust_function_shim_impl(
11131113
}
11141114
write!(out, ")");
11151115
if !indirect_return {
1116-
if let Some(ret) = &sig.ret {
1117-
if let Type::RustBox(_) | Type::UniquePtr(_) | Type::Str(_) | Type::SliceRef(_) = ret {
1118-
write!(out, ")");
1119-
}
1116+
if let Some(Type::RustBox(_) | Type::UniquePtr(_) | Type::Str(_) | Type::SliceRef(_)) =
1117+
&sig.ret
1118+
{
1119+
write!(out, ")");
11201120
}
11211121
}
11221122
writeln!(out, ";");

0 commit comments

Comments
 (0)