File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -976,6 +976,15 @@ impl<'t> Captures<'t> {
976
976
977
977
/// Get a group by index.
978
978
///
979
+ /// `'t` is the lifetime of the matched text.
980
+ ///
981
+ /// The text can't outlive the `Captures` object if this method is
982
+ /// used, because of how `Index` is defined (normally `a[i]` is part
983
+ /// of `a` and can't outlive it); to do that, use [`at()`][]
984
+ /// instead.
985
+ ///
986
+ /// [`at()`]: #method.at
987
+ ///
979
988
/// # Panics
980
989
/// If there is no group at the given index.
981
990
impl < ' t > Index < usize > for Captures < ' t > {
@@ -990,6 +999,16 @@ impl<'t> Index<usize> for Captures<'t> {
990
999
991
1000
/// Get a group by name.
992
1001
///
1002
+ /// `'t` is the lifetime of the matched text and `'i` is the lifetime
1003
+ /// of the group name (the index).
1004
+ ///
1005
+ /// The text can't outlive the `Captures` object if this method is
1006
+ /// used, because of how `Index` is defined (normally `a[i]` is part
1007
+ /// of `a` and can't outlive it); to do that, use [`name()`][]
1008
+ /// instead.
1009
+ ///
1010
+ /// [`name()`]: #method.name
1011
+ ///
993
1012
/// # Panics
994
1013
/// If there is no group named by the given value.
995
1014
impl < ' t , ' i > Index < & ' i str > for Captures < ' t > {
You can’t perform that action at this time.
0 commit comments