about summary refs log tree commit diff
path: root/src/libstd/old_path
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-31 15:59:35 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-31 15:59:35 -0700
commit3422be3666cba57f1a6fb6ab3deb1a6df66b7695 (patch)
tree224bc66e259d906532ef05f0cf98b515027e2ac5 /src/libstd/old_path
parent30283d45bb76f7300a0c99ecd719b0c649c8429a (diff)
parent608fff8582bba3ba777e3a1fc7c4ad2550bd7dcd (diff)
downloadrust-3422be3666cba57f1a6fb6ab3deb1a6df66b7695.tar.gz
rust-3422be3666cba57f1a6fb6ab3deb1a6df66b7695.zip
rollup merge of #23288: alexcrichton/issue-19470
This is a deprecated attribute that is slated for removal, and it also affects
all implementors of the trait. This commit removes the attribute and fixes up
implementors accordingly. The primary implementation which was lost was the
ability to compare `&[T]` and `Vec<T>` (in that order).

This change also modifies the `assert_eq!` macro to not consider both directions
of equality, only the one given in the left/right forms to the macro. This
modification is motivated due to the fact that `&[T] == Vec<T>` no longer
compiles, causing hundreds of errors in unit tests in the standard library (and
likely throughout the community as well).

Closes #19470
[breaking-change]
Diffstat (limited to 'src/libstd/old_path')
-rw-r--r--src/libstd/old_path/posix.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs
index f215e73202c..c517fab257f 100644
--- a/src/libstd/old_path/posix.rs
+++ b/src/libstd/old_path/posix.rs
@@ -126,7 +126,7 @@ impl GenericPathUnsafe for Path {
     unsafe fn set_filename_unchecked<T: BytesContainer>(&mut self, filename: T) {
         let filename = filename.container_as_bytes();
         match self.sepidx {
-            None if b".." == self.repr => {
+            None if self.repr == b".." => {
                 let mut v = Vec::with_capacity(3 + filename.len());
                 v.push_all(dot_dot_static);
                 v.push(SEP_BYTE);
@@ -186,7 +186,7 @@ impl GenericPath for Path {
 
     fn dirname<'a>(&'a self) -> &'a [u8] {
         match self.sepidx {
-            None if b".." == self.repr => &self.repr,
+            None if self.repr == b".." => &self.repr,
             None => dot_static,
             Some(0) => &self.repr[..1],
             Some(idx) if &self.repr[idx+1..] == b".." => &self.repr,
@@ -196,8 +196,7 @@ impl GenericPath for Path {
 
     fn filename<'a>(&'a self) -> Option<&'a [u8]> {
         match self.sepidx {
-            None if b"." == self.repr ||
-                b".." == self.repr => None,
+            None if self.repr == b"." || self.repr == b".." => None,
             None => Some(&self.repr),
             Some(idx) if &self.repr[idx+1..] == b".." => None,
             Some(0) if self.repr[1..].is_empty() => None,
@@ -207,13 +206,13 @@ impl GenericPath for Path {
 
     fn pop(&mut self) -> bool {
         match self.sepidx {
-            None if b"." == self.repr => false,
+            None if self.repr == b"." => false,
             None => {
                 self.repr = vec![b'.'];
                 self.sepidx = None;
                 true
             }
-            Some(0) if b"/" == self.repr => false,
+            Some(0) if self.repr == b"/" => false,
             Some(idx) => {
                 if idx == 0 {
                     self.repr.truncate(idx+1);
@@ -245,7 +244,7 @@ impl GenericPath for Path {
         } else {
             let mut ita = self.components();
             let mut itb = other.components();
-            if b"." == self.repr {
+            if self.repr == b"." {
                 return match itb.next() {
                     None => true,
                     Some(b) => b != b".."