Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 14 additions & 2 deletions primitives/runtime/src/bounded/bounded_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ impl<'a, T: Encode + Decode, S: Get<u32>> EncodeLike<WeakBoundedVec<T, S>>
}
impl<'a, T: Encode + Decode, S: Get<u32>> EncodeLike<Vec<T>> for BoundedSlice<'a, T, S> {}

impl<T: PartialOrd, Bound: Get<u32>> PartialOrd for BoundedVec<T, Bound> {
impl<'a, T: PartialOrd, Bound: Get<u32>> PartialOrd for BoundedSlice<'a, T, Bound> {
fn partial_cmp(&self, other: &Self) -> Option<sp_std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
}
}

impl<T: Ord, Bound: Get<u32>> Ord for BoundedVec<T, Bound> {
impl<'a, T: Ord, Bound: Get<u32>> Ord for BoundedSlice<'a, T, Bound> {
fn cmp(&self, other: &Self) -> sp_std::cmp::Ordering {
self.0.cmp(&other.0)
}
Expand Down Expand Up @@ -653,6 +653,18 @@ impl<T: PartialEq, S: Get<u32>> PartialEq<Vec<T>> for BoundedVec<T, S> {

impl<T, S: Get<u32>> Eq for BoundedVec<T, S> where T: Eq {}

impl<T: PartialOrd, Bound: Get<u32>> PartialOrd for BoundedVec<T, Bound> {
fn partial_cmp(&self, other: &Self) -> Option<sp_std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
}
}

impl<T: Ord, Bound: Get<u32>> Ord for BoundedVec<T, Bound> {
fn cmp(&self, other: &Self) -> sp_std::cmp::Ordering {
self.0.cmp(&other.0)
}
}

impl<T, S> MaxEncodedLen for BoundedVec<T, S>
where
T: MaxEncodedLen,
Expand Down
12 changes: 12 additions & 0 deletions primitives/runtime/src/bounded/weak_bounded_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,18 @@ impl<T: PartialEq, S: Get<u32>> PartialEq<Vec<T>> for WeakBoundedVec<T, S> {

impl<T, S> Eq for WeakBoundedVec<T, S> where T: Eq {}

impl<T: PartialOrd, S: Get<u32>> PartialOrd for WeakBoundedVec<T, S> {
fn partial_cmp(&self, other: &Self) -> Option<sp_std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
}
}

impl<T: Ord, S: Get<u32>> Ord for WeakBoundedVec<T, S> {
fn cmp(&self, other: &Self) -> sp_std::cmp::Ordering {
self.0.cmp(&other.0)
}
}

impl<T, S> MaxEncodedLen for WeakBoundedVec<T, S>
where
T: MaxEncodedLen,
Expand Down