Skip to content

Commit 4f83c35

Browse files
committed
Rollup merge of rust-lang#45005 - leodasvacas:inline-eq-slice-into-eq, r=jseyfried
Inline eq_slice into str::eq It's the only use of the function.
2 parents 445bbde + bb74c20 commit 4f83c35

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/libcore/str/mod.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -1405,16 +1405,6 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> {
14051405
#[allow(deprecated)]
14061406
impl<'a> FusedIterator for LinesAny<'a> {}
14071407

1408-
/*
1409-
Section: Comparing strings
1410-
*/
1411-
1412-
/// Bytewise slice equality
1413-
#[inline]
1414-
fn eq_slice(a: &str, b: &str) -> bool {
1415-
a.as_bytes() == b.as_bytes()
1416-
}
1417-
14181408
/*
14191409
Section: UTF-8 validation
14201410
*/
@@ -1590,7 +1580,6 @@ mod traits {
15901580
use cmp::Ordering;
15911581
use ops;
15921582
use slice::{self, SliceIndex};
1593-
use str::eq_slice;
15941583

15951584
/// Implements ordering of strings.
15961585
///
@@ -1611,7 +1600,7 @@ mod traits {
16111600
impl PartialEq for str {
16121601
#[inline]
16131602
fn eq(&self, other: &str) -> bool {
1614-
eq_slice(self, other)
1603+
self.as_bytes() == other.as_bytes()
16151604
}
16161605
#[inline]
16171606
fn ne(&self, other: &str) -> bool { !(*self).eq(other) }

0 commit comments

Comments
 (0)