Skip to content

Commit

Permalink
doc: clarify Captures::len includes non-matching captures
Browse files Browse the repository at this point in the history
We do the same for CaptureLocations too.

Closes #832
  • Loading branch information
CAD97 authored and BurntSushi committed Jul 5, 2022
1 parent 5e98788 commit 7d21662
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/re_bytes.rs
Expand Up @@ -877,7 +877,7 @@ impl CaptureLocations {
self.0.pos(i)
}

/// Returns the total number of capturing groups.
/// Returns the total number of capture groups (even if they didn't match).
///
/// This is always at least `1` since every regex has at least `1`
/// capturing group that corresponds to the entire match.
Expand Down Expand Up @@ -979,7 +979,7 @@ impl<'t> Captures<'t> {
expand_bytes(self, replacement, dst)
}

/// Returns the number of captured groups.
/// Returns the total number of capture groups (even if they didn't match).
///
/// This is always at least `1`, since every regex has at least one capture
/// group that corresponds to the full match.
Expand Down
4 changes: 2 additions & 2 deletions src/re_unicode.rs
Expand Up @@ -887,7 +887,7 @@ impl CaptureLocations {
self.0.pos(i)
}

/// Returns the total number of capturing groups.
/// Returns the total number of capture groups (even if they didn't match).
///
/// This is always at least `1` since every regex has at least `1`
/// capturing group that corresponds to the entire match.
Expand Down Expand Up @@ -989,7 +989,7 @@ impl<'t> Captures<'t> {
expand_str(self, replacement, dst)
}

/// Returns the number of captured groups.
/// Returns the total number of capture groups (even if they didn't match).
///
/// This is always at least `1`, since every regex has at least one capture
/// group that corresponds to the full match.
Expand Down

0 comments on commit 7d21662

Please sign in to comment.