@@ -10,19 +10,19 @@ Cross-platform file path handling
1010
1111use cmp:: Eq ;
1212
13- struct WindowsPath {
13+ pub struct WindowsPath {
1414 host : Option < ~str > ,
1515 device : Option < ~str > ,
1616 is_absolute : bool ,
1717 components : ~[ ~str ] ,
1818}
1919
20- struct PosixPath {
20+ pub struct PosixPath {
2121 is_absolute : bool ,
2222 components : ~[ ~str ] ,
2323}
2424
25- trait GenericPath {
25+ pub trait GenericPath {
2626
2727 static pure fn from_str( ( & str ) ) -> self ;
2828
@@ -45,18 +45,18 @@ trait GenericPath {
4545}
4646
4747#[ cfg( windows) ]
48- type Path = WindowsPath ;
48+ pub type Path = WindowsPath ;
4949
5050#[ cfg( windows) ]
51- pure fn Path ( s : & str ) -> Path {
51+ pub pure fn Path ( s: & str ) -> Path {
5252 from_str :: < WindowsPath > ( s )
5353}
5454
5555#[ cfg( unix) ]
56- type Path = PosixPath ;
56+ pub type Path = PosixPath ;
5757
5858#[ cfg( unix) ]
59- pure fn Path ( s : & str ) -> Path {
59+ pub pure fn Path ( s : & str ) -> Path {
6060 from_str :: < PosixPath > ( s)
6161}
6262
@@ -429,7 +429,7 @@ impl WindowsPath : GenericPath {
429429}
430430
431431
432- pure fn normalize( components : & [ ~str ] ) -> ~[ ~str ] {
432+ pub pure fn normalize( components : & [ ~str ] ) -> ~[ ~str ] {
433433 let mut cs = ~[ ] ;
434434 unsafe {
435435 for components. each |c| {
@@ -462,7 +462,6 @@ fn test_double_slash_collapsing()
462462}
463463
464464mod posix {
465- #[ legacy_exports] ;
466465
467466 #[ cfg( test) ]
468467 fn mk ( s : & str ) -> PosixPath { from_str :: < PosixPath > ( s) }
@@ -553,14 +552,13 @@ mod posix {
553552
554553// Various windows helpers, and tests for the impl.
555554mod windows {
556- #[ legacy_exports] ;
557555
558556 #[ inline( always) ]
559- pure fn is_sep ( u : u8 ) -> bool {
557+ pub pure fn is_sep ( u : u8 ) -> bool {
560558 u == '/' as u8 || u == '\\' as u8
561559 }
562560
563- pure fn extract_unc_prefix ( s : & str ) -> Option < ( ~str , ~str ) > {
561+ pub pure fn extract_unc_prefix ( s : & str ) -> Option < ( ~str , ~str ) > {
564562 if ( s. len ( ) > 1 &&
565563 s[ 0 ] == '\\' as u8 &&
566564 s[ 1 ] == '\\' as u8 ) {
@@ -577,7 +575,7 @@ mod windows {
577575 None
578576 }
579577
580- pure fn extract_drive_prefix ( s : & str ) -> Option < ( ~str , ~str ) > {
578+ pub pure fn extract_drive_prefix ( s : & str ) -> Option < ( ~str , ~str ) > {
581579 unsafe {
582580 if ( s. len ( ) > 1 &&
583581 libc:: isalpha ( s[ 0 ] as libc:: c_int ) != 0 &&
0 commit comments