diff options
| author | Stefan Lankes <stlankes@users.noreply.github.com> | 2020-04-04 07:41:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-04 07:41:05 +0200 |
| commit | aa223304dc130c5ace18d48c53b192b14088862e (patch) | |
| tree | 1971ea5717f0e2ef2dc9468b3a0e96c209d481fe /src/liballoc/string.rs | |
| parent | 9f6b96e461003853bf36052cfaf79b12e1c35413 (diff) | |
| parent | 9e55101bb681010c82c3c827305e2665fc8f2aa0 (diff) | |
| download | rust-aa223304dc130c5ace18d48c53b192b14088862e.tar.gz rust-aa223304dc130c5ace18d48c53b192b14088862e.zip | |
Merge branch 'master' into abi
Diffstat (limited to 'src/liballoc/string.rs')
| -rw-r--r-- | src/liballoc/string.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/liballoc/string.rs b/src/liballoc/string.rs index 7c89d38caa4..1e5fe125c55 100644 --- a/src/liballoc/string.rs +++ b/src/liballoc/string.rs @@ -1849,6 +1849,21 @@ impl<'a, 'b> Pattern<'a> for &'b String { fn is_prefix_of(self, haystack: &'a str) -> bool { self[..].is_prefix_of(haystack) } + + #[inline] + fn strip_prefix_of(self, haystack: &'a str) -> Option<&'a str> { + self[..].strip_prefix_of(haystack) + } + + #[inline] + fn is_suffix_of(self, haystack: &'a str) -> bool { + self[..].is_suffix_of(haystack) + } + + #[inline] + fn strip_suffix_of(self, haystack: &'a str) -> Option<&'a str> { + self[..].strip_suffix_of(haystack) + } } #[stable(feature = "rust1", since = "1.0.0")] |
