File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1665,6 +1665,15 @@ impl<'h> Captures<'h> {
1665
1665
. map ( |sp| Match :: new ( self . haystack , sp. start , sp. end ) )
1666
1666
}
1667
1667
1668
+ /// Return the overall match for the capture.
1669
+ ///
1670
+ /// This returns the match for index `0`. That is it is equivalent to
1671
+ /// `get(0).unwrap()`
1672
+ #[ inline]
1673
+ pub fn as_match ( & self ) -> Match {
1674
+ self . get ( 0 ) . unwrap ( )
1675
+ }
1676
+
1668
1677
/// Returns the `Match` associated with the capture group named `name`. If
1669
1678
/// `name` isn't a valid capture group or it refers to a group that didn't
1670
1679
/// match, then `None` is returned.
Original file line number Diff line number Diff line change @@ -1675,6 +1675,15 @@ impl<'h> Captures<'h> {
1675
1675
. map ( |sp| Match :: new ( self . haystack , sp. start , sp. end ) )
1676
1676
}
1677
1677
1678
+ /// Return the overall match for the capture.
1679
+ ///
1680
+ /// This returns the match for index `0`. That is it is equivalent to
1681
+ /// `get(0).unwrap()`
1682
+ #[ inline]
1683
+ pub fn as_match ( & self ) -> Match {
1684
+ self . get ( 0 ) . unwrap ( )
1685
+ }
1686
+
1678
1687
/// Returns the `Match` associated with the capture group named `name`. If
1679
1688
/// `name` isn't a valid capture group or it refers to a group that didn't
1680
1689
/// match, then `None` is returned.
You can’t perform that action at this time.
0 commit comments