diff --git a/src/regex/bytes.rs b/src/regex/bytes.rs index fd36c8676..ea4f7cd65 100644 --- a/src/regex/bytes.rs +++ b/src/regex/bytes.rs @@ -1989,7 +1989,7 @@ impl<'h> core::ops::Index for Captures<'h> { /// The haystack substring returned can't outlive the `Captures` object if this /// method is used, because of how `Index` is defined (normally `a[i]` is part /// of `a` and can't outlive it). To work around this limitation, do that, use -/// [`Captures::get`] instead. +/// [`Captures::name`] instead. /// /// `'h` is the lifetime of the matched haystack, but the lifetime of the /// `&str` returned by this implementation is the lifetime of the `Captures` diff --git a/src/regex/string.rs b/src/regex/string.rs index 25f43a7f3..824f45c69 100644 --- a/src/regex/string.rs +++ b/src/regex/string.rs @@ -1992,7 +1992,7 @@ impl<'h> core::ops::Index for Captures<'h> { /// The haystack substring returned can't outlive the `Captures` object if this /// method is used, because of how `Index` is defined (normally `a[i]` is part /// of `a` and can't outlive it). To work around this limitation, do that, use -/// [`Captures::get`] instead. +/// [`Captures::name`] instead. /// /// `'h` is the lifetime of the matched haystack, but the lifetime of the /// `&str` returned by this implementation is the lifetime of the `Captures`