Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example code in Repeated::exactly #676

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading