Skip to content

Commit

Permalink
doc: fix link in Index<&str> impl docs
Browse files Browse the repository at this point in the history
This referenced `Captures::get`, but it should reference
`Captures::name`. This was likely a transcription error
from the docs for the `Index<usize>` impl.
  • Loading branch information
kloune committed Dec 20, 2023
1 parent 4f5992f commit a3d5975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/regex/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1989,7 +1989,7 @@ impl<'h> core::ops::Index<usize> 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`
Expand Down
2 changes: 1 addition & 1 deletion src/regex/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1992,7 +1992,7 @@ impl<'h> core::ops::Index<usize> 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`
Expand Down

0 comments on commit a3d5975

Please sign in to comment.