diff options
| author | Michael Sullivan <sully@msully.net> | 2012-06-29 16:26:56 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-06-29 17:41:45 -0700 |
| commit | 98e161f00e8850b0f5c6a3a9f1b22b222c2355b7 (patch) | |
| tree | 4e026fed97dda63a5394b86235a27eeb1015b094 /src/libcore/path.rs | |
| parent | e6baf44f1982d1a5e49cc4a0b5eaeb857418e35e (diff) | |
Switch the compiler over to using ~[] notation instead of []/~. Closes #2759.
Diffstat (limited to 'src/libcore/path.rs')
| -rw-r--r-- | src/libcore/path.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libcore/path.rs b/src/libcore/path.rs index e75f104bea4..fb92138f4a8 100644 --- a/src/libcore/path.rs +++ b/src/libcore/path.rs @@ -127,7 +127,7 @@ Connects a vector of path segments into a single path. Inserts path separators as needed. "] -fn connect_many(paths: [path]/~) -> path { +fn connect_many(paths: ~[path]) -> path { ret if vec::len(paths) == 1u { paths[0] } else { @@ -144,7 +144,7 @@ each piece of the path. On Windows, if the path is absolute then the first element of the returned vector will be the drive letter followed by a colon. "] -fn split(p: path) -> [path]/~ { +fn split(p: path) -> ~[path] { str::split_nonempty(p, {|c| c == consts::path_sep || c == consts::alt_path_sep }) @@ -234,7 +234,7 @@ fn normalize(p: path) -> path { ret s; - fn strip_dots(s: [path]/~) -> [path]/~ { + fn strip_dots(s: ~[path]) -> ~[path] { vec::filter_map(s, { |elem| if elem == "." { option::none @@ -244,12 +244,12 @@ fn normalize(p: path) -> path { }) } - fn rollup_doubledots(s: [path]/~) -> [path]/~ { + fn rollup_doubledots(s: ~[path]) -> ~[path] { if vec::is_empty(s) { - ret []/~; + ret ~[]; } - let mut t = []/~; + let mut t = ~[]; let mut i = vec::len(s); let mut skip = 0; while i != 0u { @@ -322,28 +322,28 @@ mod tests { #[test] fn split1() { let actual = split("a" + ps() + "b"); - let expected = ["a", "b"]/~; + let expected = ~["a", "b"]; assert actual == expected; } #[test] fn split2() { let actual = split("a" + aps() + "b"); - let expected = ["a", "b"]/~; + let expected = ~["a", "b"]; assert actual == expected; } #[test] fn split3() { let actual = split(ps() + "a" + ps() + "b"); - let expected = ["a", "b"]/~; + let expected = ~["a", "b"]; assert actual == expected; } #[test] fn split4() { let actual = split("a" + ps() + "b" + aps() + "c"); - let expected = ["a", "b", "c"]/~; + let expected = ~["a", "b", "c"]; assert actual == expected; } |
