mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 17:11:02 +00:00
[Fix] parameter_types! dead code errors (#12340)
* [Fix] parameter_types! dead code errors * mark the whole impl allow(unused)
This commit is contained in:
@@ -361,9 +361,9 @@ macro_rules! parameter_types {
|
||||
}
|
||||
};
|
||||
(IMPL_STORAGE $name:ident, $type:ty, $value:expr $(, $ty_params:ident)*) => {
|
||||
#[allow(unused)]
|
||||
impl< $($ty_params),* > $name< $($ty_params),* > {
|
||||
/// Returns the key for this parameter type.
|
||||
#[allow(unused)]
|
||||
pub fn key() -> [u8; 16] {
|
||||
$crate::sp_core_hashing_proc_macro::twox_128!(b":", $name, b":")
|
||||
}
|
||||
@@ -372,7 +372,6 @@ macro_rules! parameter_types {
|
||||
///
|
||||
/// This needs to be executed in an externalities provided
|
||||
/// environment.
|
||||
#[allow(unused)]
|
||||
pub fn set(value: &$type) {
|
||||
$crate::storage::unhashed::put(&Self::key(), value);
|
||||
}
|
||||
@@ -448,6 +447,7 @@ macro_rules! parameter_types_impl_thread_local {
|
||||
}
|
||||
|
||||
/// Mutate the internal value in place.
|
||||
#[allow(unused)]
|
||||
pub fn mutate<R, F: FnOnce(&mut $type) -> R>(mutate: F) -> R{
|
||||
let mut current = Self::get();
|
||||
let result = mutate(&mut current);
|
||||
@@ -456,6 +456,7 @@ macro_rules! parameter_types_impl_thread_local {
|
||||
}
|
||||
|
||||
/// Get current value and replace with initial value of the parameter type.
|
||||
#[allow(unused)]
|
||||
pub fn take() -> $type {
|
||||
let current = Self::get();
|
||||
Self::set($value);
|
||||
|
||||
Reference in New Issue
Block a user