diff options
| author | Mehmet Ali Anil <[email protected]> | 2023-03-07 23:21:39 +0100 |
|---|---|---|
| committer | Mehmet Ali Anil <[email protected]> | 2023-03-07 23:35:56 +0100 |
| commit | b1bc034a7e9127a604016dca7a82b7b4cb732432 (patch) | |
| tree | 8c727e293186cf619ae75a174efa13a6aab09528 | |
| parent | 6bf8d090a19cba3b2458c9156e1007f6776d79d9 (diff) | |
| parent | 4054fb8779acae214333ffef995e4e5547f49851 (diff) | |
Merge branch 'emb-storage-async-0p4' of https://github.com/Grus-BV/embassy into emb-storage-async-0p4
| -rw-r--r-- | embassy-boot/boot/src/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/embassy-boot/boot/src/lib.rs b/embassy-boot/boot/src/lib.rs index 00cf2dfc6..0df44f36e 100644 --- a/embassy-boot/boot/src/lib.rs +++ b/embassy-boot/boot/src/lib.rs | |||
| @@ -1197,6 +1197,7 @@ impl FirmwareWriter { | |||
| 1197 | #[cfg(test)] | 1197 | #[cfg(test)] |
| 1198 | mod tests { | 1198 | mod tests { |
| 1199 | use core::convert::Infallible; | 1199 | use core::convert::Infallible; |
| 1200 | |||
| 1200 | use embedded_storage::nor_flash::ErrorType; | 1201 | use embedded_storage::nor_flash::ErrorType; |
| 1201 | use embedded_storage_async::nor_flash::ReadNorFlash as AsyncReadNorFlash; | 1202 | use embedded_storage_async::nor_flash::ReadNorFlash as AsyncReadNorFlash; |
| 1202 | use futures::executor::block_on; | 1203 | use futures::executor::block_on; |
| @@ -1535,9 +1536,9 @@ mod tests { | |||
| 1535 | const READ_SIZE: usize = 1; | 1536 | const READ_SIZE: usize = 1; |
| 1536 | 1537 | ||
| 1537 | async fn read(&mut self, offset: u32, buf: &mut [u8]) -> Result<(), Self::Error> { | 1538 | async fn read(&mut self, offset: u32, buf: &mut [u8]) -> Result<(), Self::Error> { |
| 1538 | let len = buf.len(); | 1539 | let len = buf.len(); |
| 1539 | buf[..].copy_from_slice(&self.0[offset as usize..offset as usize + len]); | 1540 | buf[..].copy_from_slice(&self.0[offset as usize..offset as usize + len]); |
| 1540 | Ok(()) | 1541 | Ok(()) |
| 1541 | } | 1542 | } |
| 1542 | 1543 | ||
| 1543 | fn capacity(&self) -> usize { | 1544 | fn capacity(&self) -> usize { |
