aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Henrik Tjäder <henrik@tjaders.com> 2020-06-03 10:34:01 +0000
committerGravatar Henrik Tjäder <henrik@tjaders.com> 2020-06-03 10:34:01 +0000
commit137283959c1b3d0e6f51757b6875d33824ff3ac0 (patch)
tree8320c6ad8a464f32ed6f79688f2c5fde1659eb5e
parent7406f77a4ec163165fa2f89e8e9351b792e305e3 (diff)
downloadrtic-137283959c1b3d0e6f51757b6875d33824ff3ac0.tar.gz
rtic-137283959c1b3d0e6f51757b6875d33824ff3ac0.tar.zst
rtic-137283959c1b3d0e6f51757b6875d33824ff3ac0.zip
Run cargo fmt
-rw-r--r--examples/t-cfg-resources.rs2
-rw-r--r--macros/src/codegen.rs3
-rw-r--r--macros/src/codegen/init.rs6
-rw-r--r--macros/src/codegen/post_init.rs7
4 files changed, 9 insertions, 9 deletions
diff --git a/examples/t-cfg-resources.rs b/examples/t-cfg-resources.rs
index 86b5ea20..63c41245 100644
--- a/examples/t-cfg-resources.rs
+++ b/examples/t-cfg-resources.rs
@@ -28,7 +28,7 @@ mod example {
// The feature needs to be applied everywhere x is defined or used
#[cfg(feature = "feature_x")]
x: 0,
- dummy: () // dummy such that we have at least one late resource
+ dummy: (), // dummy such that we have at least one late resource
}
}
diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs
index 7d0d1220..60074849 100644
--- a/macros/src/codegen.rs
+++ b/macros/src/codegen.rs
@@ -39,7 +39,8 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
let (const_app_init, root_init, user_init, call_init) =
init::codegen(core, app, analysis, extra);
- let (const_app_post_init, post_init_stmts) = post_init::codegen(core, &app, analysis, extra);
+ let (const_app_post_init, post_init_stmts) =
+ post_init::codegen(core, &app, analysis, extra);
let (const_app_idle, root_idle, user_idle, call_idle) =
idle::codegen(core, app, analysis, extra);
diff --git a/macros/src/codegen/init.rs b/macros/src/codegen/init.rs
index f7e4674e..9e5c4798 100644
--- a/macros/src/codegen/init.rs
+++ b/macros/src/codegen/init.rs
@@ -47,9 +47,9 @@ pub fn codegen(
let cfgs = &app.late_resources[name].cfgs;
quote!(
- #(#cfgs)*
- pub #name: #ty
- )
+ #(#cfgs)*
+ pub #name: #ty
+ )
})
.collect::<Vec<_>>()
})
diff --git a/macros/src/codegen/post_init.rs b/macros/src/codegen/post_init.rs
index 8578d5ac..b816e072 100644
--- a/macros/src/codegen/post_init.rs
+++ b/macros/src/codegen/post_init.rs
@@ -16,16 +16,15 @@ pub fn codegen(
// initialize late resources
if let Some(late_resources) = analysis.late_resources.get(&core) {
-
for name in late_resources {
// if it's live
let cfgs = app.late_resources[name].cfgs.clone();
if analysis.locations.get(name).is_some() {
// Need to also include the cfgs
stmts.push(quote!(
- #(#cfgs)*
- #name.as_mut_ptr().write(late.#name);
- ));
+ #(#cfgs)*
+ #name.as_mut_ptr().write(late.#name);
+ ));
}
}
}