diff --git a/frame/support/src/storage/generator/double_map.rs b/frame/support/src/storage/generator/double_map.rs index e5ee7ec45b13e..7e1a2456e4536 100644 --- a/frame/support/src/storage/generator/double_map.rs +++ b/frame/support/src/storage/generator/double_map.rs @@ -383,7 +383,7 @@ impl< iterator } - fn translate Option>(f: F) { + fn translate Option>(mut f: F) { let prefix = G::prefix_hash(); let mut previous_key = prefix.clone(); while let Some(next) = sp_io::storage::next_key(&previous_key) diff --git a/frame/support/src/storage/generator/map.rs b/frame/support/src/storage/generator/map.rs index 198fad08dc731..7f6eb2a518f57 100644 --- a/frame/support/src/storage/generator/map.rs +++ b/frame/support/src/storage/generator/map.rs @@ -162,7 +162,7 @@ impl< iterator } - fn translate Option>(f: F) { + fn translate Option>(mut f: F) { let prefix = G::prefix_hash(); let mut previous_key = prefix.clone(); while let Some(next) = sp_io::storage::next_key(&previous_key) diff --git a/frame/support/src/storage/mod.rs b/frame/support/src/storage/mod.rs index dbb1062c24639..93cf7c6639064 100644 --- a/frame/support/src/storage/mod.rs +++ b/frame/support/src/storage/mod.rs @@ -315,7 +315,7 @@ pub trait IterableStorageMap: StorageMap { /// By returning `None` from `f` for an element, you'll remove it from the map. /// /// NOTE: If a value fail to decode because storage is corrupted then it is skipped. - fn translate Option>(f: F); + fn translate Option>(f: F); } /// A strongly-typed double map in storage whose secondary keys and values can be iterated over. @@ -352,7 +352,7 @@ pub trait IterableStorageDoubleMap< /// By returning `None` from `f` for an element, you'll remove it from the map. /// /// NOTE: If a value fail to decode because storage is corrupted then it is skipped. - fn translate Option>(f: F); + fn translate Option>(f: F); } /// An implementation of a map with a two keys. @@ -614,7 +614,7 @@ pub trait StoragePrefixedMap { /// # Usage /// /// This would typically be called inside the module implementation of on_runtime_upgrade. - fn translate_values Option>(f: F) { + fn translate_values Option>(mut f: F) { let prefix = Self::final_prefix(); let mut previous_key = prefix.clone().to_vec(); while let Some(next) = sp_io::storage::next_key(&previous_key) diff --git a/frame/support/src/storage/types/double_map.rs b/frame/support/src/storage/types/double_map.rs index 93f40b660f7b8..f0b5f66eff058 100644 --- a/frame/support/src/storage/types/double_map.rs +++ b/frame/support/src/storage/types/double_map.rs @@ -326,7 +326,7 @@ where /// # Usage /// /// This would typically be called inside the module implementation of on_runtime_upgrade. - pub fn translate_values Option>(f: F) { + pub fn translate_values Option>(f: F) { >::translate_values(f) } } @@ -379,7 +379,7 @@ where /// By returning `None` from `f` for an element, you'll remove it from the map. /// /// NOTE: If a value fail to decode because storage is corrupted then it is skipped. - pub fn translate Option>(f: F) { + pub fn translate Option>(f: F) { >::translate(f) } } diff --git a/frame/support/src/storage/types/map.rs b/frame/support/src/storage/types/map.rs index 5c236e7f6b598..4af28a77cf2b6 100644 --- a/frame/support/src/storage/types/map.rs +++ b/frame/support/src/storage/types/map.rs @@ -249,7 +249,7 @@ where /// # Usage /// /// This would typically be called inside the module implementation of on_runtime_upgrade. - pub fn translate_values Option>(f: F) { + pub fn translate_values Option>(f: F) { >::translate_values(f) } } @@ -283,7 +283,7 @@ where /// By returning `None` from `f` for an element, you'll remove it from the map. /// /// NOTE: If a value fail to decode because storage is corrupted then it is skipped. - pub fn translate Option>(f: F) { + pub fn translate Option>(f: F) { >::translate(f) } }