mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
Purify Contains, add IsInVec, All and SortedMembers (#8589)
* IsInVec * Purify `Contains`, introduce SortedMembers
This commit is contained in:
@@ -459,13 +459,16 @@ macro_rules! ord_parameter_types {
|
||||
);
|
||||
() => ();
|
||||
(IMPL $name:ident , $type:ty , $value:expr) => {
|
||||
impl $crate::traits::Contains<$type> for $name {
|
||||
impl $crate::traits::SortedMembers<$type> for $name {
|
||||
fn contains(t: &$type) -> bool { &$value == t }
|
||||
fn sorted_members() -> $crate::sp_std::prelude::Vec<$type> { vec![$value] }
|
||||
fn count() -> usize { 1 }
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn add(_: &$type) {}
|
||||
}
|
||||
impl $crate::traits::Contains<$type> for $name {
|
||||
fn contains(t: &$type) -> bool { &$value == t }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user