Skip to content

Commit

Permalink
fix(combinator): Apply epage PR review
Browse files Browse the repository at this point in the history
- Rename {try,verify}_fold_impl functions
- remove doc alias
  • Loading branch information
Altair-Bueno authored and epage committed Jan 10, 2025
1 parent 8a9eacd commit 54786bd
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/combinator/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,6 @@ where
/// assert_eq!(parser("123123"), Ok(("123123", HashSet::from([]))));
/// assert_eq!(parser(""), Ok(("", HashSet::from([]))));
/// ```
#[doc(alias = "verify_fold_many0")]
#[doc(alias = "verify_fold_many1")]
#[doc(alias = "verify_fold_many_m_n")]
#[doc(alias = "verify_fold_repeat")]
#[inline(always)]
pub fn verify_fold<Init, Op, Result>(
mut self,
Expand All @@ -354,7 +350,7 @@ where
end_inclusive,
} = self.occurrences;
trace("repeat_verify_fold", move |input: &mut Input| {
verify_fold_impl(
verify_fold_m_n(
start_inclusive,
end_inclusive.unwrap_or(usize::MAX),
&mut self.parser,
Expand Down Expand Up @@ -412,10 +408,6 @@ where
/// assert_eq!(parser("abc123"), Ok(("123", b"abc".to_vec())));
/// assert_eq!(parser("123123"), Ok(("123123", vec![])));
/// assert_eq!(parser(""), Ok(("", vec![])));
#[doc(alias = "try_fold_many0")]
#[doc(alias = "try_fold_many1")]
#[doc(alias = "try_fold_many_m_n")]
#[doc(alias = "try_fold_repeat")]
#[inline(always)]
pub fn try_fold<Init, Op, OpError, Result>(
mut self,
Expand All @@ -432,7 +424,7 @@ where
end_inclusive,
} = self.occurrences;
trace("repeat_try_fold", move |input: &mut Input| {
try_fold_impl(
try_fold_m_n(
start_inclusive,
end_inclusive.unwrap_or(usize::MAX),
&mut self.parser,
Expand Down Expand Up @@ -1488,7 +1480,7 @@ where
}

#[inline(always)]
fn verify_fold_impl<I, O, E, F, G, H, R>(
fn verify_fold_m_n<I, O, E, F, G, H, R>(
min: usize,
max: usize,
parse: &mut F,
Expand Down Expand Up @@ -1553,7 +1545,7 @@ where
}

#[inline(always)]
fn try_fold_impl<I, O, E, F, G, H, R, GE>(
fn try_fold_m_n<I, O, E, F, G, H, R, GE>(
min: usize,
max: usize,
parse: &mut F,
Expand Down

0 comments on commit 54786bd

Please sign in to comment.