Skip to content

Commit d108a22

Browse files
committed
path2: Update for privacy changes
Remove redundant `contains_nul` definition. Make `parse_prefix` private.
1 parent 6eade9e commit d108a22

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/libstd/path/posix.rs

-6
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,6 @@ fn normalize_helper<'a>(v: &'a [u8], is_abs: bool) -> Option<~[&'a [u8]]> {
439439
}
440440
}
441441

442-
// FIXME (#8169): Pull this into parent module once visibility works
443-
#[inline(always)]
444-
fn contains_nul(v: &[u8]) -> bool {
445-
v.iter().any(|&x| x == 0)
446-
}
447-
448442
static dot_static: &'static [u8] = bytes!(".");
449443
static dot_dot_static: &'static [u8] = bytes!("..");
450444

src/libstd/path/windows.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use str;
2121
use str::{CharSplitIterator, OwnedStr, Str, StrVector};
2222
use to_bytes::IterBytes;
2323
use vec::Vector;
24-
use super::{BytesContainer, GenericPath, GenericPathUnsafe};
24+
use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe};
2525

2626
#[cfg(target_os = "win32")]
2727
use libc;
@@ -922,9 +922,8 @@ pub enum PathPrefix {
922922
DiskPrefix
923923
}
924924

925-
/// Internal function; only public for tests. Don't use.
926925
// FIXME (#8169): Make private once visibility is fixed
927-
pub fn parse_prefix<'a>(mut path: &'a str) -> Option<PathPrefix> {
926+
fn parse_prefix<'a>(mut path: &'a str) -> Option<PathPrefix> {
928927
if path.starts_with("\\\\") {
929928
// \\
930929
path = path.slice_from(2);
@@ -1032,12 +1031,6 @@ fn normalize_helper<'a>(s: &'a str, prefix: Option<PathPrefix>) -> (bool,Option<
10321031
}
10331032
}
10341033

1035-
// FIXME (#8169): Pull this into parent module once visibility works
1036-
#[inline(always)]
1037-
fn contains_nul(v: &[u8]) -> bool {
1038-
v.iter().any(|&x| x == 0)
1039-
}
1040-
10411034
fn prefix_is_verbatim(p: Option<PathPrefix>) -> bool {
10421035
match p {
10431036
Some(VerbatimPrefix(_)) | Some(VerbatimUNCPrefix(_,_)) | Some(VerbatimDiskPrefix) => true,
@@ -1136,6 +1129,7 @@ impl Path {
11361129
#[cfg(test)]
11371130
mod tests {
11381131
use super::*;
1132+
use super::parse_prefix;
11391133
use option::{Some,None};
11401134
use iter::Iterator;
11411135
use vec::Vector;

0 commit comments

Comments
 (0)