about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/path2/posix.rs8
-rw-r--r--src/libstd/path2/windows.rs8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/libstd/path2/posix.rs b/src/libstd/path2/posix.rs
index 11579ba0956..9157243244e 100644
--- a/src/libstd/path2/posix.rs
+++ b/src/libstd/path2/posix.rs
@@ -19,6 +19,7 @@ use iter::{AdditiveIterator, Extendable, Iterator};
 use option::{Option, None, Some};
 use str;
 use str::Str;
+use to_bytes::IterBytes;
 use util;
 use vec;
 use vec::CopyableVector;
@@ -75,6 +76,13 @@ impl ToCStr for Path {
     }
 }
 
+impl IterBytes for Path {
+    #[inline]
+    fn iter_bytes(&self, lsb0: bool, f: &fn(buf: &[u8]) -> bool) -> bool {
+        self.repr.iter_bytes(lsb0, f)
+    }
+}
+
 impl GenericPathUnsafe for Path {
     unsafe fn from_vec_unchecked(path: &[u8]) -> Path {
         let path = Path::normalize(path);
diff --git a/src/libstd/path2/windows.rs b/src/libstd/path2/windows.rs
index 2545ba8ada2..2ab8a2c0140 100644
--- a/src/libstd/path2/windows.rs
+++ b/src/libstd/path2/windows.rs
@@ -19,6 +19,7 @@ use iter::{AdditiveIterator, Extendable, Iterator};
 use option::{Option, Some, None};
 use str;
 use str::{OwnedStr, Str, StrVector};
+use to_bytes::IterBytes;
 use util;
 use vec::Vector;
 use super::{GenericPath, GenericPathUnsafe};
@@ -97,6 +98,13 @@ impl ToCStr for Path {
     }
 }
 
+impl IterBytes for Path {
+    #[inline]
+    fn iter_bytes(&self, lsb0: bool, f: &fn(&[u8]) -> bool) -> bool {
+        self.repr.iter_bytes(lsb0, f)
+    }
+}
+
 impl GenericPathUnsafe for Path {
     /// See `GenericPathUnsafe::from_vec_unchecked`.
     ///