File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1670,16 +1670,18 @@ impl<'h> Captures<'h> {
1670
1670
/// This returns the match for index `0`. That is it is equivalent to
1671
1671
/// `m.get(0).unwrap()`
1672
1672
///
1673
+ /// # Example
1674
+ ///
1673
1675
/// ```
1674
1676
/// use regex::bytes::Regex;
1675
1677
///
1676
1678
/// let re = Regex::new(r"[a-z]+([0-9]+)").unwrap();
1677
1679
/// let caps = re.captures(b" abc123-def").unwrap();
1678
1680
///
1679
- /// assert_eq!(caps.as_match ().as_bytes(), b"abc123");
1681
+ /// assert_eq!(caps.get_match ().as_bytes(), b"abc123");
1680
1682
/// ```
1681
1683
#[ inline]
1682
- pub fn as_match ( & self ) -> Match {
1684
+ pub fn get_match ( & self ) -> Match {
1683
1685
self . get ( 0 ) . unwrap ( )
1684
1686
}
1685
1687
Original file line number Diff line number Diff line change @@ -1680,17 +1680,19 @@ impl<'h> Captures<'h> {
1680
1680
/// This returns the match for index `0`. That is it is equivalent to
1681
1681
/// `m.get(0).unwrap()`
1682
1682
///
1683
+ /// # Example
1684
+ ///
1683
1685
/// ```
1684
1686
/// use regex::Regex;
1685
1687
///
1686
1688
/// let re = Regex::new(r"[a-z]+([0-9]+)").unwrap();
1687
1689
/// let caps = re.captures(" abc123-def").unwrap();
1688
1690
///
1689
- /// assert_eq!(caps.as_match ().as_str(), "abc123");
1691
+ /// assert_eq!(caps.get_match ().as_str(), "abc123");
1690
1692
///
1691
1693
/// ```
1692
1694
#[ inline]
1693
- pub fn as_match ( & self ) -> Match {
1695
+ pub fn get_match ( & self ) -> Match {
1694
1696
self . get ( 0 ) . unwrap ( )
1695
1697
}
1696
1698
You can’t perform that action at this time.
0 commit comments