summaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2022-03-15 04:01:13 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2022-03-15 04:01:13 +0100
commitc27578fac5372575e3caa933a83eac931ae3b53f (patch)
treeef71b7bf50a178e96f35e89d734c98493b548ae6 /src/codegen
parent9689aecbfe45c9ba18d6d95de3cb903b1740b8cf (diff)
codegen: Fix minor clippy warning.
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/mod.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 7c8e2646..ffa6879b 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -3907,25 +3907,19 @@ impl CodeGenerator for Function {
Linkage::External => {}
}
- #[allow(clippy::needless_late_init)]
- let is_dynamic_function;
// Pure virtual methods have no actual symbol, so we can't generate
// something meaningful for them.
- match self.kind() {
+ let is_dynamic_function = match self.kind() {
FunctionKind::Method(ref method_kind)
if method_kind.is_pure_virtual() =>
{
return None;
}
FunctionKind::Function => {
- // If we're generating for dynamic loading, some attributes can not be emitted.
- is_dynamic_function =
- ctx.options().dynamic_library_name.is_some()
+ ctx.options().dynamic_library_name.is_some()
}
- _ => {
- is_dynamic_function = false;
- }
- }
+ _ => false,
+ };
// Similar to static member variables in a class template, we can't
// generate bindings to template functions, because the set of