about summary refs log tree commit diff
path: root/src/liballoc/string.rs
diff options
context:
space:
mode:
authorStefan Lankes <stlankes@users.noreply.github.com>2020-04-04 07:41:05 +0200
committerGitHub <noreply@github.com>2020-04-04 07:41:05 +0200
commitaa223304dc130c5ace18d48c53b192b14088862e (patch)
tree1971ea5717f0e2ef2dc9468b3a0e96c209d481fe /src/liballoc/string.rs
parent9f6b96e461003853bf36052cfaf79b12e1c35413 (diff)
parent9e55101bb681010c82c3c827305e2665fc8f2aa0 (diff)
downloadrust-aa223304dc130c5ace18d48c53b192b14088862e.tar.gz
rust-aa223304dc130c5ace18d48c53b192b14088862e.zip
Merge branch 'master' into abi
Diffstat (limited to 'src/liballoc/string.rs')
-rw-r--r--src/liballoc/string.rs15
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")]