Skip to content

Commit 7b3036d

Browse files
committed
---
yaml --- r: 81618 b: refs/heads/snap-stage3 c: ed539e1 h: refs/heads/master v: v3
1 parent c55d7c8 commit 7b3036d

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: eaec8a71322a59eb284cbd5a8d502b6da321df3c
4+
refs/heads/snap-stage3: ed539e14712539473c3e89604cb69e2307110772
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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)