diff options
| author | Ben Gamari <[email protected]> | 2021-07-31 11:51:40 -0400 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-08-05 22:39:59 +0200 |
| commit | f4950c44499b2d1ba1280000a05a1a5edd03d8ca (patch) | |
| tree | ba2c93392868fe6910868d1d5d58562760ed0ab7 /examples/stm32f4/src/bin/button.rs | |
| parent | 36402b5487a7001c859bf85673e74c64cc2b59cd (diff) | |
examples: Consistently use unwrap! in favor of .unwrap()
Unfortunately errors from `embedded_graphics` and `core` doesn't provide
the necessary instances currently.
Diffstat (limited to 'examples/stm32f4/src/bin/button.rs')
| -rw-r--r-- | examples/stm32f4/src/bin/button.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/stm32f4/src/bin/button.rs b/examples/stm32f4/src/bin/button.rs index 82c83e80e..90998cf46 100644 --- a/examples/stm32f4/src/bin/button.rs +++ b/examples/stm32f4/src/bin/button.rs | |||
| @@ -28,14 +28,14 @@ fn main() -> ! { | |||
| 28 | let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); | 28 | let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); |
| 29 | 29 | ||
| 30 | loop { | 30 | loop { |
| 31 | if button.is_high().unwrap() { | 31 | if unwrap!(button.is_high()) { |
| 32 | info!("high"); | 32 | info!("high"); |
| 33 | led1.set_high().unwrap(); | 33 | unwrap!(led1.set_high()); |
| 34 | led3.set_low().unwrap(); | 34 | unwrap!(led3.set_low()); |
| 35 | } else { | 35 | } else { |
| 36 | info!("low"); | 36 | info!("low"); |
| 37 | led1.set_low().unwrap(); | 37 | unwrap!(led1.set_low()); |
| 38 | led3.set_high().unwrap(); | 38 | unwrap!(led3.set_high()); |
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | } | 41 | } |
