Skip to content

Commit a45068c

Browse files
committed
Convert fs::path_is_absolute internals to istrs. Issue #855
1 parent cc08fd1 commit a45068c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn list_dir(p: &path) -> [istr] {
6161
}
6262
6363
fn path_is_absolute(p: &path) -> bool {
64-
ret os_fs::path_is_absolute(istr::to_estr(p));
64+
ret os_fs::path_is_absolute(p);
6565
}
6666
6767
// FIXME: under Windows, we should prepend the current drive letter to paths

src/lib/posix_fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn list_dir(path: str) -> [str] {
3232

3333
}
3434

35-
fn path_is_absolute(p: str) -> bool { ret str::char_at(p, 0u) == '/'; }
35+
fn path_is_absolute(p: &istr) -> bool { ret istr::char_at(p, 0u) == '/'; }
3636

3737
const path_sep: char = '/';
3838

src/lib/win32_fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ native "rust" mod rustrt {
77

88
fn list_dir(path: str) -> [str] { ret *rustrt::rust_list_files(path + "*"); }
99

10-
fn path_is_absolute(p: str) -> bool {
11-
ret str::char_at(p, 0u) == '/' ||
12-
str::char_at(p, 1u) == ':' && str::char_at(p, 2u) == '\\';
10+
fn path_is_absolute(p: &istr) -> bool {
11+
ret istr::char_at(p, 0u) == '/' ||
12+
istr::char_at(p, 1u) == ':' && istr::char_at(p, 2u) == '\\';
1313
}
1414

1515
/* FIXME: win32 path handling actually accepts '/' or '\' and has subtly

0 commit comments

Comments
 (0)