aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/module.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2022-03-01 17:44:02 +0000
committerGravatar GitHub <noreply@github.com> 2022-03-01 17:44:02 +0000
commit2e4cbe9df595c2c4cb90c788030351a7f91339f6 (patch)
tree2e1bf40e2eaeeb4b58c996c1659c8a7429e2a518 /macros/src/codegen/module.rs
parent57da1e0403510cafbdcf88e402b39ae6d3bf323e (diff)
parent5ed93bd1bf056f1d2b8632502300d7488df4e9df (diff)
downloadrtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.tar.gz
rtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.tar.zst
rtic-2e4cbe9df595c2c4cb90c788030351a7f91339f6.zip
Merge #617
617: Clippy with pedantic suggestions r=korken89 a=AfoHT Co-authored-by: Henrik Tjäder <henrik@grepit.se>
Diffstat (limited to 'macros/src/codegen/module.rs')
-rw-r--r--macros/src/codegen/module.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs
index 8410b7d7..fd8137fa 100644
--- a/macros/src/codegen/module.rs
+++ b/macros/src/codegen/module.rs
@@ -3,6 +3,7 @@ use proc_macro2::TokenStream as TokenStream2;
use quote::quote;
use rtic_syntax::{ast::App, Context};
+#[allow(clippy::too_many_lines)]
pub fn codegen(
ctxt: Context,
shared_resources_tick: bool,
@@ -50,11 +51,7 @@ pub fn codegen(
values.push(quote!(core));
}
- Context::Idle => {}
-
- Context::HardwareTask(_) => {}
-
- Context::SoftwareTask(_) => {}
+ Context::Idle | Context::HardwareTask(_) | Context::SoftwareTask(_) => {}
}
// if ctxt.has_locals(app) {
@@ -438,7 +435,9 @@ pub fn codegen(
}
}
- if !items.is_empty() {
+ if items.is_empty() {
+ quote!()
+ } else {
quote!(
#(#items)*
@@ -449,7 +448,5 @@ pub fn codegen(
#(#module_items)*
}
)
- } else {
- quote!()
}
}