about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorleonardo.yvens <leoyvens@gmail.com>2017-10-02 22:04:23 -0300
committerleonardo.yvens <leoyvens@gmail.com>2017-10-02 22:04:23 -0300
commitbb74c20a5d2594cab6d9416c2ed2cc8bd45fc956 (patch)
tree3beac70f2fbec8d83f494865576b9951c4bb8749 /src/libcore
parent185cc5f26d2c8a794189b028b43f6a3b8fc586db (diff)
downloadrust-bb74c20a5d2594cab6d9416c2ed2cc8bd45fc956.tar.gz
rust-bb74c20a5d2594cab6d9416c2ed2cc8bd45fc956.zip
Inline eq_slice into str::eq
It's the only use of the function.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/str/mod.rs13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs
index 0af9fcf0a3d..670c2afa66f 100644
--- a/src/libcore/str/mod.rs
+++ b/src/libcore/str/mod.rs
@@ -1406,16 +1406,6 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> {
 impl<'a> FusedIterator for LinesAny<'a> {}
 
 /*
-Section: Comparing strings
-*/
-
-/// Bytewise slice equality
-#[inline]
-fn eq_slice(a: &str, b: &str) -> bool {
-    a.as_bytes() == b.as_bytes()
-}
-
-/*
 Section: UTF-8 validation
 */
 
@@ -1590,7 +1580,6 @@ mod traits {
     use cmp::Ordering;
     use ops;
     use slice::{self, SliceIndex};
-    use str::eq_slice;
 
     /// Implements ordering of strings.
     ///
@@ -1611,7 +1600,7 @@ mod traits {
     impl PartialEq for str {
         #[inline]
         fn eq(&self, other: &str) -> bool {
-            eq_slice(self, other)
+            self.as_bytes() == other.as_bytes()
         }
         #[inline]
         fn ne(&self, other: &str) -> bool { !(*self).eq(other) }