Skip to content

Commit c27578f

Browse files
committed
codegen: Fix minor clippy warning.
1 parent 9689aec commit c27578f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/codegen/mod.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -3907,25 +3907,19 @@ impl CodeGenerator for Function {
39073907
Linkage::External => {}
39083908
}
39093909

3910-
#[allow(clippy::needless_late_init)]
3911-
let is_dynamic_function;
39123910
// Pure virtual methods have no actual symbol, so we can't generate
39133911
// something meaningful for them.
3914-
match self.kind() {
3912+
let is_dynamic_function = match self.kind() {
39153913
FunctionKind::Method(ref method_kind)
39163914
if method_kind.is_pure_virtual() =>
39173915
{
39183916
return None;
39193917
}
39203918
FunctionKind::Function => {
3921-
// If we're generating for dynamic loading, some attributes can not be emitted.
3922-
is_dynamic_function =
3923-
ctx.options().dynamic_library_name.is_some()
3919+
ctx.options().dynamic_library_name.is_some()
39243920
}
3925-
_ => {
3926-
is_dynamic_function = false;
3927-
}
3928-
}
3921+
_ => false,
3922+
};
39293923

39303924
// Similar to static member variables in a class template, we can't
39313925
// generate bindings to template functions, because the set of

0 commit comments

Comments
 (0)