Skip to content

Commit ac4a6fb

Browse files
committed
---
yaml --- r: 83134 b: refs/heads/auto c: ed539e1 h: refs/heads/master v: v3
1 parent 71100a0 commit ac4a6fb

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: eaec8a71322a59eb284cbd5a8d502b6da321df3c
16+
refs/heads/auto: ed539e14712539473c3e89604cb69e2307110772
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/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)