Skip to content

Commit

Permalink
Merge pull request #676 from istathar/fix-dwarven-rings
Browse files Browse the repository at this point in the history
Fix example code in Repeated::exactly
  • Loading branch information
zesterer authored Sep 28, 2024
2 parents 8151341 + 860b6d4 commit 716bec8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/combinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ where
///
/// let for_the_dwarves = ring
/// .repeated()
/// .exactly(6)
/// .exactly(7)
/// .collect::<Vec<_>>();
///
/// let for_the_humans = ring
Expand All @@ -1403,12 +1403,12 @@ where
/// .then(for_the_humans)
/// .then(for_sauron);
///
/// assert!(rings.parse("OOOOOOOOOOOOOOOOOO").has_errors()); // Too few rings!
/// assert!(rings.parse("OOOOOOOOOOOOOOOOOOOO").has_errors()); // Too many rings!
/// assert!(rings.parse("OOOOOOOOOOOOOOOOOOO").has_errors()); // Too few rings!
/// assert!(rings.parse("OOOOOOOOOOOOOOOOOOOOO").has_errors()); // Too many rings!
/// // The perfect number of rings
/// assert_eq!(
/// rings.parse("OOOOOOOOOOOOOOOOOOO").into_result(),
/// Ok(((((vec!['O'; 3]), vec!['O'; 6]), vec!['O'; 9]), vec!['O'; 1])),
/// rings.parse("OOOOOOOOOOOOOOOOOOOO").into_result(),
/// Ok(((((vec!['O'; 3]), vec!['O'; 7]), vec!['O'; 9]), vec!['O'; 1])),
/// );
/// ````
pub fn exactly(self, exactly: usize) -> Self {
Expand Down

0 comments on commit 716bec8

Please sign in to comment.