about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-10-16 09:55:55 -0700
committerKevin Ballard <kevin@sb.org>2013-10-16 11:18:06 -0700
commitd108a22fd1b38c108e2b9b6cd7276d953524ffa2 (patch)
tree7918be0e9c581c1107e2b233397a311aea3f7726 /src/libstd/path
parent6eade9e9143e496167d66298e8bbac5d9dfa3e19 (diff)
downloadrust-d108a22fd1b38c108e2b9b6cd7276d953524ffa2.tar.gz
rust-d108a22fd1b38c108e2b9b6cd7276d953524ffa2.zip
path2: Update for privacy changes
Remove redundant `contains_nul` definition.

Make `parse_prefix` private.
Diffstat (limited to 'src/libstd/path')
-rw-r--r--src/libstd/path/posix.rs6
-rw-r--r--src/libstd/path/windows.rs12
2 files changed, 3 insertions, 15 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index 271937dfcf2..87821105d37 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -439,12 +439,6 @@ fn normalize_helper<'a>(v: &'a [u8], is_abs: bool) -> Option<~[&'a [u8]]> {
     }
 }
 
-// FIXME (#8169): Pull this into parent module once visibility works
-#[inline(always)]
-fn contains_nul(v: &[u8]) -> bool {
-    v.iter().any(|&x| x == 0)
-}
-
 static dot_static: &'static [u8] = bytes!(".");
 static dot_dot_static: &'static [u8] = bytes!("..");
 
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 0ee0d9c79d1..0de2bd4c742 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -21,7 +21,7 @@ use str;
 use str::{CharSplitIterator, OwnedStr, Str, StrVector};
 use to_bytes::IterBytes;
 use vec::Vector;
-use super::{BytesContainer, GenericPath, GenericPathUnsafe};
+use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe};
 
 #[cfg(target_os = "win32")]
 use libc;
@@ -922,9 +922,8 @@ pub enum PathPrefix {
     DiskPrefix
 }
 
-/// Internal function; only public for tests. Don't use.
 // FIXME (#8169): Make private once visibility is fixed
-pub fn parse_prefix<'a>(mut path: &'a str) -> Option<PathPrefix> {
+fn parse_prefix<'a>(mut path: &'a str) -> Option<PathPrefix> {
     if path.starts_with("\\\\") {
         // \\
         path = path.slice_from(2);
@@ -1032,12 +1031,6 @@ fn normalize_helper<'a>(s: &'a str, prefix: Option<PathPrefix>) -> (bool,Option<
     }
 }
 
-// FIXME (#8169): Pull this into parent module once visibility works
-#[inline(always)]
-fn contains_nul(v: &[u8]) -> bool {
-    v.iter().any(|&x| x == 0)
-}
-
 fn prefix_is_verbatim(p: Option<PathPrefix>) -> bool {
     match p {
         Some(VerbatimPrefix(_)) | Some(VerbatimUNCPrefix(_,_)) | Some(VerbatimDiskPrefix) => true,
@@ -1136,6 +1129,7 @@ impl Path {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use super::parse_prefix;
     use option::{Some,None};
     use iter::Iterator;
     use vec::Vector;