@@ -131,14 +131,8 @@ pub async fn fetch_item<'d, K: Key, V: Value<'d>, S: NorFlash>(
131
131
) -> Result < Option < V > , Error < S :: Error > > {
132
132
let result = run_with_auto_repair ! (
133
133
function = {
134
- fetch_item_with_location(
135
- flash,
136
- flash_range. clone( ) ,
137
- cache,
138
- data_buffer,
139
- search_key,
140
- )
141
- . await
134
+ fetch_item_with_location( flash, flash_range. clone( ) , cache, data_buffer, search_key)
135
+ . await
142
136
} ,
143
137
repair = try_repair:: <K , _>( flash, flash_range. clone( ) , cache, data_buffer) . await ?
144
138
) ;
@@ -180,7 +174,7 @@ async fn fetch_item_with_location<'d, K: Key, S: NorFlash>(
180
174
}
181
175
182
176
' cache: {
183
- if let Some ( cached_location) = cache. key_location ( & search_key) {
177
+ if let Some ( cached_location) = cache. key_location ( search_key) {
184
178
let page_index = calculate_page_index :: < S > ( flash_range. clone ( ) , cached_location) ;
185
179
let page_data_end_address =
186
180
calculate_page_end_address :: < S > ( flash_range. clone ( ) , page_index)
@@ -345,15 +339,8 @@ pub async fn store_item<'d, K: Key, V: Value<'d>, S: NorFlash>(
345
339
item : & V ,
346
340
) -> Result < ( ) , Error < S :: Error > > {
347
341
run_with_auto_repair ! (
348
- function = store_item_inner(
349
- flash,
350
- flash_range. clone( ) ,
351
- cache,
352
- data_buffer,
353
- key,
354
- item
355
- )
356
- . await ,
342
+ function =
343
+ store_item_inner( flash, flash_range. clone( ) , cache, data_buffer, key, item) . await ,
357
344
repair = try_repair:: <K , _>( flash, flash_range. clone( ) , cache, data_buffer) . await ?
358
345
)
359
346
}
@@ -903,14 +890,9 @@ async fn migrate_items<K: Key, S: NorFlash>(
903
890
cache. unmark_dirty ( ) ;
904
891
905
892
// Search for the newest item with the key we found
906
- let Some ( ( found_item, found_address, _) ) = fetch_item_with_location :: < K , S > (
907
- flash,
908
- flash_range. clone ( ) ,
909
- cache,
910
- data_buffer,
911
- & key,
912
- )
913
- . await ?
893
+ let Some ( ( found_item, found_address, _) ) =
894
+ fetch_item_with_location :: < K , S > ( flash, flash_range. clone ( ) , cache, data_buffer, & key)
895
+ . await ?
914
896
else {
915
897
// We couldn't even find our own item?
916
898
return Err ( Error :: Corrupted {
0 commit comments