From 7d21662735ffdf585ca6bff773d997fe44a4f868 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Fri, 28 Jan 2022 09:31:34 -0600 Subject: [PATCH] doc: clarify Captures::len includes non-matching captures We do the same for CaptureLocations too. Closes #832 --- src/re_bytes.rs | 4 ++-- src/re_unicode.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/re_bytes.rs b/src/re_bytes.rs index 7f372ebb2..245447b12 100644 --- a/src/re_bytes.rs +++ b/src/re_bytes.rs @@ -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. @@ -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. diff --git a/src/re_unicode.rs b/src/re_unicode.rs index 46e70f218..53e7804bb 100644 --- a/src/re_unicode.rs +++ b/src/re_unicode.rs @@ -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. @@ -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.