From b894ab9ce75533574588d463d303e5441d9307b1 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (42 Technology)" Date: Mon, 27 Sep 2021 18:43:01 +0100 Subject: [PATCH] Cleaning up. --- rp2040-hal/examples/lcd_display.rs | 3 ++- rp2040-hal/examples/spi.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rp2040-hal/examples/lcd_display.rs b/rp2040-hal/examples/lcd_display.rs index 99c7e61..4447b24 100644 --- a/rp2040-hal/examples/lcd_display.rs +++ b/rp2040-hal/examples/lcd_display.rs @@ -96,7 +96,8 @@ fn main() -> ! { pins.gpio20.into_push_pull_output(), // d6 pins.gpio21.into_push_pull_output(), // d7 &mut delay, - ).unwrap(); + ) + .unwrap(); // Clear the screen lcd.reset(&mut delay).unwrap(); diff --git a/rp2040-hal/examples/spi.rs b/rp2040-hal/examples/spi.rs index 868dff2..255a4df 100644 --- a/rp2040-hal/examples/spi.rs +++ b/rp2040-hal/examples/spi.rs @@ -85,7 +85,7 @@ fn main() -> ! { let _spi_mosi = pins.gpio7.into_mode::(); let _spi_miso = pins.gpio4.into_mode::(); let spi = hal::spi::Spi::<_, _, 8>::new(pac.SPI0); - + // Exchange the uninitialised SPI driver for an initialised one let mut spi = spi.init( &mut pac.RESETS, @@ -95,7 +95,7 @@ fn main() -> ! { ); // Write out 0, ignore return value - if let Ok(_) = spi.write(&[0]) { + if spi.write(&[0]).is_ok() { // SPI write was succesful };