Skip to content

Commit 47fb541

Browse files
committed
---
yaml --- r: 145950 b: refs/heads/try2 c: ed539e1 h: refs/heads/master v: v3
1 parent db6d154 commit 47fb541

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: eaec8a71322a59eb284cbd5a8d502b6da321df3c
8+
refs/heads/try2: ed539e14712539473c3e89604cb69e2307110772
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/path/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Option<&str> with `.as_str()`. Similarly, attributes of the path can be queried
4343
with methods such as `.filename()`. There are also methods that return a new
4444
path instead of modifying the receiver, such as `.join()` or `.dir_path()`.
4545
46+
Paths are always kept in normalized form. This means that creating the path
47+
`Path::from_str("a/b/../c")` will return the path `a/c`. Similarly any attempt
48+
to mutate the path will always leave it in normalized form.
49+
4650
When rendering a path to some form of display, there is a method `.display()`
4751
which is compatible with the `format!()` parameter `{}`. This will render the
4852
path as a string, replacing all non-utf8 sequences with the Replacement

branches/try2/src/libstd/path/posix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ impl Path {
349349

350350
/// Returns a normalized byte vector representation of a path, by removing all empty
351351
/// components, and unnecessary . and .. components.
352-
pub fn normalize<V: Vector<u8>+CopyableVector<u8>>(v: V) -> ~[u8] {
352+
fn normalize<V: Vector<u8>+CopyableVector<u8>>(v: V) -> ~[u8] {
353353
// borrowck is being very picky
354354
let val = {
355355
let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == sep;

branches/try2/src/libstd/path/windows.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,6 @@ impl Path {
697697
Some(self.repr)
698698
}
699699

700-
/// Returns a normalized string representation of a path, by removing all empty
701-
/// components, and unnecessary . and .. components.
702-
pub fn normalize<S: Str>(s: S) -> ~str {
703-
let (_, path) = Path::normalize_(s);
704-
path
705-
}
706-
707700
/// Returns an iterator that yields each component of the path in turn as a Option<&str>.
708701
/// Every component is guaranteed to be Some.
709702
/// Does not yield the path prefix (including server/share components in UNC paths).

0 commit comments

Comments
 (0)