mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-24 02:49:34 +01:00
don't generate empty modules
This commit is contained in:
parent
b37c45ad2a
commit
dd539d114f
1 changed files with 16 additions and 11 deletions
|
@ -153,12 +153,14 @@ fn idle(
|
|||
exprs.push(quote!(unsafe { idle::Resources::new() }));
|
||||
}
|
||||
|
||||
root.push(quote! {
|
||||
#[allow(unsafe_code)]
|
||||
mod idle {
|
||||
#(#mod_items)*
|
||||
}
|
||||
});
|
||||
if !mod_items.is_empty() {
|
||||
root.push(quote! {
|
||||
#[allow(unsafe_code)]
|
||||
mod idle {
|
||||
#(#mod_items)*
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let idle = &app.idle.path;
|
||||
main.push(quote! {
|
||||
|
@ -486,12 +488,15 @@ fn resources(app: &App, ownerships: &Ownerships, root: &mut Vec<Tokens>) {
|
|||
}
|
||||
}
|
||||
|
||||
if !items.is_empty() {
|
||||
root.push(quote! {
|
||||
#[allow(unsafe_code)]
|
||||
mod _resource {
|
||||
#(#items)*
|
||||
}
|
||||
})
|
||||
}
|
||||
root.push(quote! {
|
||||
#[allow(unsafe_code)]
|
||||
mod _resource {
|
||||
#(#items)*
|
||||
}
|
||||
|
||||
#(#impls)*
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue