Skip to content

Commit

Permalink
change signature
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoikey committed Oct 2, 2024
1 parent 6bfee00 commit f2d7819
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/rule/collection/skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ where
let (mut is_valid, mut message) = (true, String::new());
let mut accumlator = None;
for (i, item) in remains.by_ref().enumerate() {
if OPTION::should_skip(i, &item, accumlator.as_mut()) {
if OPTION::should_skip(i, accumlator.as_mut(), &item) {
result.push_back(item);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rule/collection/skip/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub trait SkipOption {
type Accumulator;
fn should_skip(
i: usize,
item: &Self::Item,
accumulator: Option<&mut Self::Accumulator>,
item: &Self::Item,
) -> bool;
}
2 changes: 1 addition & 1 deletion src/rule/collection/skip/option/no_skip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct NoSkip<T> {
impl<ITEM> SkipOption for NoSkip<ITEM> {
type Item = ITEM;
type Accumulator = ();
fn should_skip(_: usize, _: &Self::Item, _: Option<&mut Self::Accumulator>) -> bool {
fn should_skip(_: usize, _: Option<&mut Self::Accumulator>, _: &Self::Item) -> bool {
false
}
}
2 changes: 1 addition & 1 deletion src/rule/collection/skip/option/skip_first.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct SkipFirst<ITEM> {
impl<ITEM> SkipOption for SkipFirst<ITEM> {
type Item = ITEM;
type Accumulator = ();
fn should_skip(i: usize, _: &Self::Item, _: Option<&mut Self::Accumulator>) -> bool {
fn should_skip(i: usize, _: Option<&mut Self::Accumulator>, _: &Self::Item) -> bool {
i == 0
}
}

0 comments on commit f2d7819

Please sign in to comment.