Skip to content

Commit 5d31339

Browse files
author
Simon Struck
committed
Fix doctest
1 parent b1db2b4 commit 5d31339

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/lib.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
//! # struct DummyDelayer;
2525
//! # use embedded_hal::spi::Operation;
2626
//! # use embedded_hal::spi::ErrorType;
27+
//! # use core::convert::Infallible;
28+
//! # use core::fmt;
2729
//! # impl ErrorType for DummySpi {
28-
//! # type Error = ();
30+
//! # type Error = Infallible;
2931
//! # }
3032
//! # impl embedded_hal::spi::SpiDevice<u8> for DummySpi {
3133
//! #
@@ -50,22 +52,21 @@
5052
//! # }
5153
//! # }
5254
//! # impl embedded_hal::digital::ErrorType for DummyCsPin {
53-
//! # type Error = ();
55+
//! # type Error = Infallible;
5456
//! # }
5557
//! # impl embedded_hal::digital::OutputPin for DummyCsPin {
56-
//! # fn set_low(&mut self) -> Result<(), ()> { Ok(()) }
57-
//! # fn set_high(&mut self) -> Result<(), ()> { Ok(()) }
58+
//! # fn set_low(&mut self) -> Result<(), Self::Error> { Ok(()) }
59+
//! # fn set_high(&mut self) -> Result<(), Self::Error> { Ok(()) }
5860
//! # }
5961
//! # impl embedded_sdmmc::TimeSource for DummyTimeSource {
6062
//! # fn get_timestamp(&self) -> embedded_sdmmc::Timestamp { embedded_sdmmc::Timestamp::from_fat(0, 0) }
6163
//! # }
6264
//! # impl embedded_hal::delay::DelayUs for DummyDelayer {
63-
//! # fn delay_us(&mut self, us: u8) {}
65+
//! # fn delay_us(&mut self, us: u32) {}
6466
//! # }
65-
//! # impl std::fmt::Write for DummyUart {
66-
//! # fn write_str(&mut self, s: &str) -> std::fmt::Result { Ok(()) }
67+
//! # impl fmt::Write for DummyUart {
68+
//! # fn write_str(&mut self, s: &str) -> fmt::Result { Ok(()) }
6769
//! # }
68-
//! # use std::fmt::Write;
6970
//! # use embedded_sdmmc::VolumeManager;
7071
//! # fn main() -> Result<(), embedded_sdmmc::Error<embedded_sdmmc::SdCardError>> {
7172
//! # let mut sdmmc_spi = DummySpi;
@@ -74,7 +75,7 @@
7475
//! # let delayer = DummyDelayer;
7576
//! # let sdcard = embedded_sdmmc::SdCard::new(sdmmc_spi, sdmmc_cs, delayer);
7677
//! # println!("Card size is {} bytes", sdcard.num_bytes()?);
77-
//! # let mut volume_mgr = embedded_sdmmc::VolumeManager::new(sdcard, time_source);
78+
//! # let mut volume_mgr = VolumeManager::new(sdcard, time_source);
7879
//! # let mut volume0 = volume_mgr.open_volume(embedded_sdmmc::VolumeIdx(0))?;
7980
//! # println!("Volume 0: {:?}", volume0);
8081
//! # let mut root_dir = volume0.open_root_dir()?;

0 commit comments

Comments
 (0)