Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion frame/support/src/traits/members.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ pub trait Contains<T> {

/// A `Contains` implementation which always returns `true`.
pub struct All<T>(PhantomData<T>);
impl<T: Ord> Contains<T> for All<T> {
impl<T> Contains<T> for All<T> {
fn contains(_: &T) -> bool { true }
}

#[impl_trait_for_tuples::impl_for_tuples(30)]
impl<T> Contains<T> for Tuple {
fn contains(t: &T) -> bool {
for_tuples!( #(
if Tuple::contains(t) { return true }
)* );
false
}
}

/// Create a type which implements the `Contains` trait for a particular type with syntax similar
/// to `matches!`.
#[macro_export]
Expand Down