Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit c7bfca1

Browse files
authored
Raised nits on #3813 (#3844)
1 parent 1c1c37f commit c7bfca1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

runtime/parachains/src/util.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ pub fn make_persisted_validation_data<T: paras::Config + hrmp::Config>(
4343

4444
/// Take an active subset of a set containing all validators.
4545
///
46-
/// First item in pair will be all items in set have indeces found in the `active` indices set (in
46+
/// First item in pair will be all items in set have indices found in the `active` indices set (in
4747
/// the order of the `active` vec, the second item will contain the rest, in the original order.
4848
///
4949
/// ```ignore
50-
/// split_active_subset(active.into_iter().collect(), all).0 == take_active_subset(active, all)
50+
/// split_active_subset(active, all).0 == take_active_subset(active, all)
5151
/// ```
5252
pub fn split_active_subset<T: Clone>(active: &[ValidatorIndex], all: &[T]) -> (Vec<T>, Vec<T>) {
5353
let active_set: BTreeSet<_> = active.iter().cloned().collect();
@@ -73,6 +73,10 @@ pub fn split_active_subset<T: Clone>(active: &[ValidatorIndex], all: &[T]) -> (V
7373
}
7474

7575
/// Uses `split_active_subset` and concatenates the inactive to the active vec.
76+
///
77+
/// ```ignore
78+
/// split_active_subset(active, all)[0..active.len()]) == take_active_subset(active, all)
79+
/// ```
7680
pub fn take_active_subset_and_inactive<T: Clone>(active: &[ValidatorIndex], all: &[T]) -> Vec<T> {
7781
let (mut a, mut i) = split_active_subset(active, all);
7882
a.append(&mut i);

0 commit comments

Comments
 (0)