diff --git a/src/rule/collection/skip.rs b/src/rule/collection/skip.rs index 7a1f4e0..ad60dac 100644 --- a/src/rule/collection/skip.rs +++ b/src/rule/collection/skip.rs @@ -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; } diff --git a/src/rule/collection/skip/option.rs b/src/rule/collection/skip/option.rs index 0e3888d..2e05b53 100644 --- a/src/rule/collection/skip/option.rs +++ b/src/rule/collection/skip/option.rs @@ -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; } diff --git a/src/rule/collection/skip/option/no_skip.rs b/src/rule/collection/skip/option/no_skip.rs index b87b765..3602a0c 100644 --- a/src/rule/collection/skip/option/no_skip.rs +++ b/src/rule/collection/skip/option/no_skip.rs @@ -7,7 +7,7 @@ pub struct NoSkip { impl SkipOption for NoSkip { 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 } } diff --git a/src/rule/collection/skip/option/skip_first.rs b/src/rule/collection/skip/option/skip_first.rs index 914ec52..0b78f9c 100644 --- a/src/rule/collection/skip/option/skip_first.rs +++ b/src/rule/collection/skip/option/skip_first.rs @@ -7,7 +7,7 @@ pub struct SkipFirst { impl SkipOption for SkipFirst { 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 } }