diff options
author | 2023-01-11 21:33:44 +0100 | |
---|---|---|
committer | 2023-01-11 21:33:44 +0100 | |
commit | 1fe587c5160b9e99bbb67644318cb9e5c9c56b4e (patch) | |
tree | 226bb5664329af932c9444cdc1b8134dcfd3c929 /examples/lock.rs | |
parent | 67cccbd4819c4d874780a6b388d7f10c1c8031b2 (diff) | |
download | rtic-1fe587c5160b9e99bbb67644318cb9e5c9c56b4e.tar.gz rtic-1fe587c5160b9e99bbb67644318cb9e5c9c56b4e.tar.zst rtic-1fe587c5160b9e99bbb67644318cb9e5c9c56b4e.zip |
Remove unwrap() from hprintln!()
sd 'hprintln(.*).unwrap\(\)' 'hprintln' (fd -e rs .)
Diffstat (limited to 'examples/lock.rs')
-rw-r--r-- | examples/lock.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/lock.rs b/examples/lock.rs index f1a16968..16f3b338 100644 --- a/examples/lock.rs +++ b/examples/lock.rs @@ -29,7 +29,7 @@ mod app { // when omitted priority is assumed to be `1` #[task(shared = [shared])] fn foo(mut c: foo::Context) { - hprintln!("A").unwrap(); + hprintln!("A"); // the lower priority task requires a critical section to access the data c.shared.shared.lock(|shared| { @@ -39,7 +39,7 @@ mod app { // bar will *not* run right now due to the critical section bar::spawn().unwrap(); - hprintln!("B - shared = {}", *shared).unwrap(); + hprintln!("B - shared = {}", *shared); // baz does not contend for `shared` so it's allowed to run now baz::spawn().unwrap(); @@ -47,7 +47,7 @@ mod app { // critical section is over: bar can now start - hprintln!("E").unwrap(); + hprintln!("E"); debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } @@ -61,11 +61,11 @@ mod app { *shared }); - hprintln!("D - shared = {}", shared).unwrap(); + hprintln!("D - shared = {}", shared); } #[task(priority = 3)] fn baz(_: baz::Context) { - hprintln!("C").unwrap(); + hprintln!("C"); } } |