File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -951,6 +951,15 @@ impl<'t> Captures<'t> {
951
951
952
952
/// Get a group by index.
953
953
///
954
+ /// `'t` is the lifetime of the matched text.
955
+ ///
956
+ /// The text can't outlive the `Captures` object if this method is
957
+ /// used, because of how `Index` is defined (normally `a[i]` is part
958
+ /// of `a` and can't outlive it); to do that, use [`at()`][]
959
+ /// instead.
960
+ ///
961
+ /// [`at()`]: #method.at
962
+ ///
954
963
/// # Panics
955
964
/// If there is no group at the given index.
956
965
impl < ' t > Index < usize > for Captures < ' t > {
@@ -965,6 +974,16 @@ impl<'t> Index<usize> for Captures<'t> {
965
974
966
975
/// Get a group by name.
967
976
///
977
+ /// `'t` is the lifetime of the matched text and `'i` is the lifetime
978
+ /// of the group name (the index).
979
+ ///
980
+ /// The text can't outlive the `Captures` object if this method is
981
+ /// used, because of how `Index` is defined (normally `a[i]` is part
982
+ /// of `a` and can't outlive it); to do that, use [`name()`][]
983
+ /// instead.
984
+ ///
985
+ /// [`name()`]: #method.name
986
+ ///
968
987
/// # Panics
969
988
/// If there is no group named by the given value.
970
989
impl < ' t , ' i > Index < & ' i str > for Captures < ' t > {
You can’t perform that action at this time.
0 commit comments