Skip to content

Commit 8062533

Browse files
ruseinovark0f
authored andcommitted
[Fix] parameter_types! dead code errors (paritytech#12340)
* [Fix] parameter_types! dead code errors * mark the whole impl allow(unused)
1 parent 092a700 commit 8062533

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frame/support/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ macro_rules! parameter_types {
361361
}
362362
};
363363
(IMPL_STORAGE $name:ident, $type:ty, $value:expr $(, $ty_params:ident)*) => {
364+
#[allow(unused)]
364365
impl< $($ty_params),* > $name< $($ty_params),* > {
365366
/// Returns the key for this parameter type.
366-
#[allow(unused)]
367367
pub fn key() -> [u8; 16] {
368368
$crate::sp_core_hashing_proc_macro::twox_128!(b":", $name, b":")
369369
}
@@ -372,7 +372,6 @@ macro_rules! parameter_types {
372372
///
373373
/// This needs to be executed in an externalities provided
374374
/// environment.
375-
#[allow(unused)]
376375
pub fn set(value: &$type) {
377376
$crate::storage::unhashed::put(&Self::key(), value);
378377
}
@@ -448,6 +447,7 @@ macro_rules! parameter_types_impl_thread_local {
448447
}
449448

450449
/// Mutate the internal value in place.
450+
#[allow(unused)]
451451
pub fn mutate<R, F: FnOnce(&mut $type) -> R>(mutate: F) -> R{
452452
let mut current = Self::get();
453453
let result = mutate(&mut current);
@@ -456,6 +456,7 @@ macro_rules! parameter_types_impl_thread_local {
456456
}
457457

458458
/// Get current value and replace with initial value of the parameter type.
459+
#[allow(unused)]
459460
pub fn take() -> $type {
460461
let current = Self::get();
461462
Self::set($value);

0 commit comments

Comments
 (0)