From 2c390572d2912ee435c99e96f21d9b63c75f84bf Mon Sep 17 00:00:00 2001 From: mwojcik Date: Fri, 1 Nov 2024 16:54:26 +0800 Subject: [PATCH] composer part fixes and cleanup --- nac3core/src/toplevel/composer.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nac3core/src/toplevel/composer.rs b/nac3core/src/toplevel/composer.rs index 5e86cb38..9e8edb88 100644 --- a/nac3core/src/toplevel/composer.rs +++ b/nac3core/src/toplevel/composer.rs @@ -2140,14 +2140,17 @@ impl TopLevelComposer { { let subkernel_dest = keywords.iter().find(|keyword| { if keyword.node.arg == Some("destination".into()) { - if let ExprKind::Constant { value, .. } = &keyword.node.value.node { - return true; + match &keyword.node.value.node { + ExprKind::Constant { .. } => true, + _ => false } + } else { + false } - false } ).node.value.node.value; - if let Some(Constant::Int(sk_dest)) == subkernel_dest { + // treat subkernel as kernel if the destination is the same as currently compiled + if let Some(Constant::Int(sk_dest)) = subkernel_dest { if sk_dest != destination.unwrap_or(0) { instance_to_symbol.insert(String::new(), simple_name.to_string()); }