diff --git a/Cargo.toml b/Cargo.toml index 52ae306..cb80a68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ keywords = ["storage"] categories = ["embedded", "hardware-support", "no-std"] [dependencies] -heapless = "^0.5" \ No newline at end of file +heapless = "^0.5" diff --git a/src/lib.rs b/src/lib.rs index 681caa5..b254072 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ pub trait ReadStorage { /// operation at the given address offset, and reading `bytes.len()` bytes. /// /// This should throw an error in case `bytes.len()` will be larger than - /// `self.capacity()`. + /// `self.capacity() - offset`. fn try_read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error>; /// The capacity of the storage peripheral in bytes. diff --git a/src/nor_flash.rs b/src/nor_flash.rs index 211ffc7..22c7101 100644 --- a/src/nor_flash.rs +++ b/src/nor_flash.rs @@ -11,7 +11,7 @@ pub trait ReadNorFlash { /// Read a slice of data from the storage peripheral, starting the read /// operation at the given address offset, and reading `bytes.len()` bytes. /// - /// This should throw an error in case `bytes.len()` will be larger than + /// This should throw an error in case `bytes.len()` will be larger than /// the peripheral end address. fn try_read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error>;