aboutsummaryrefslogtreecommitdiff
path: root/examples/generics.rs
diff options
context:
space:
mode:
authorGravatar bors[bot] <26634292+bors[bot]@users.noreply.github.com> 2020-10-05 08:40:19 +0000
committerGravatar GitHub <noreply@github.com> 2020-10-05 08:40:19 +0000
commitdbf9a7f2983fb00aee130305fec0019c12eaef76 (patch)
tree0422a3712af398436cebfa9f8e6ac422de65dde1 /examples/generics.rs
parent04d415c3c6cce7f763decdf02104d827f2e4de7c (diff)
parent95503b6bdff3f392450d1972b0c499b79a9c2092 (diff)
downloadrtic-dbf9a7f2983fb00aee130305fec0019c12eaef76.tar.gz
rtic-dbf9a7f2983fb00aee130305fec0019c12eaef76.tar.zst
rtic-dbf9a7f2983fb00aee130305fec0019c12eaef76.zip
Merge #368
368: Mod over const r=korken89 a=AfoHT Related [RFC](https://github.com/rtic-rs/rfcs/pull/34) Dependent on [rtic-syntax-PR30](https://github.com/rtic-rs/rtic-syntax/pull/30) ~~Currently using my own dev-branch~~ Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to 'examples/generics.rs')
-rw-r--r--examples/generics.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/generics.rs b/examples/generics.rs
index 40ab81ac..c65e6518 100644
--- a/examples/generics.rs
+++ b/examples/generics.rs
@@ -11,7 +11,8 @@ use panic_semihosting as _;
use rtic::{Exclusive, Mutex};
#[rtic::app(device = lm3s6965)]
-const APP: () = {
+mod app {
+ #[resources]
struct Resources {
#[init(0)]
shared: u32,
@@ -49,7 +50,7 @@ const APP: () = {
// second argument has type `Exclusive<u32>`
advance(STATE, Exclusive(c.resources.shared));
}
-};
+}
// the second parameter is generic: it can be any type that implements the `Mutex` trait
fn advance(state: &mut u32, mut shared: impl Mutex<T = u32>) {