Skip to content

Commit 3a2735c

Browse files
committed
path2: Convert typedefs to pub uses
Turns out you can't call static methods on typedefs. Use `pub use` instead to work around this issue.
1 parent 179f50f commit 3a2735c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/libstd/path2/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,38 @@ use vec;
2121
use vec::{CopyableVector, OwnedCopyableVector, OwnedVector};
2222
use vec::{ImmutableEqVector, ImmutableVector};
2323

24-
pub mod posix;
25-
pub mod windows;
26-
2724
/// Typedef for POSIX file paths.
2825
/// See `posix::Path` for more info.
29-
pub type PosixPath = posix::Path;
26+
pub use PosixPath = self::posix::Path;
3027

3128
/// Typedef for Windows file paths.
3229
/// See `windows::Path` for more info.
33-
pub type WindowsPath = windows::Path;
30+
pub use WindowsPath = self::windows::Path;
3431

3532
/// Typedef for the platform-native path type
3633
#[cfg(unix)]
37-
pub type Path = PosixPath;
34+
pub use Path = self::posix::Path;
3835
/// Typedef for the platform-native path type
3936
#[cfg(windows)]
40-
pub type Path = WindowsPath;
37+
pub use Path = self::windows::Path;
4138

4239
/// Typedef for the POSIX path component iterator.
4340
/// See `posix::ComponentIter` for more info.
44-
pub type PosixComponentIter<'self> = posix::ComponentIter<'self>;
41+
pub use PosixComponentIter = self::posix::ComponentIter;
4542

46-
// /// Typedef for the Windows path component iterator.
47-
// /// See `windows::ComponentIter` for more info.
48-
// pub type WindowsComponentIter<'self> = windows::ComponentIter<'self>;
43+
/// Typedef for the Windows path component iterator.
44+
/// See `windows::ComponentIter` for more info.
45+
pub use WindowsComponentIter = self::windows::ComponentIter;
4946

5047
/// Typedef for the platform-native component iterator
5148
#[cfg(unix)]
52-
pub type ComponentIter<'self> = PosixComponentIter<'self>;
53-
// /// Typedef for the platform-native component iterator
54-
//#[cfg(windows)]
55-
//pub type ComponentIter<'self> = WindowsComponentIter<'self>;
49+
pub use ComponentIter = self::posix::ComponentIter;
50+
/// Typedef for the platform-native component iterator
51+
#[cfg(windows)]
52+
pub use ComponentIter = self::windows::ComponentIter;
53+
54+
pub mod posix;
55+
pub mod windows;
5656

5757
// Condition that is raised when a NUL is found in a byte vector given to a Path function
5858
condition! {

0 commit comments

Comments
 (0)