From d3cdf72a0b96f0ae1e6debfcb348499af076e2df Mon Sep 17 00:00:00 2001 From: Dion Dokter Date: Sun, 4 Aug 2024 13:29:55 +0200 Subject: [PATCH] Add clarifying docs --- src/map.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/map.rs b/src/map.rs index 5e7f59f..4881db7 100644 --- a/src/map.rs +++ b/src/map.rs @@ -530,6 +530,9 @@ async fn store_item_inner<'d, K: Key, S: NorFlash>( /// /// All items in flash have to be read and deserialized to find the items with the key. /// This is unlikely to be cached well. +/// +/// Alternatively, e.g. when you don't have a [MultiwriteNorFlash] flash, you could store your value inside an Option +/// and store the value `None` to mark it as erased. /// /// ///
@@ -564,7 +567,11 @@ pub async fn remove_item( /// new items are stored again. /// ///
-/// This might be really slow! +/// This might be really slow! This doesn't simply erase flash, but goes through all items and marks them as deleted. +/// This is better for flash endurance. +/// +/// You might want to simply erase the flash range, e.g. if your flash does not implement [MultiwriteNorFlash]. +/// Consider using the helper method for that: [crate::erase_all]. ///
/// ///