diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-06 16:29:47 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-09 09:44:51 -0700 |
| commit | ab5935c88d259d511561ccb4177bb6924dab4a06 (patch) | |
| tree | f23ddc5fb8733a5eeb5f3fbac06b99159139687e /src/libstd/path | |
| parent | d9874bfb4079876dabc092c035d99b2d5b7f8a1c (diff) | |
| download | rust-ab5935c88d259d511561ccb4177bb6924dab4a06.tar.gz rust-ab5935c88d259d511561ccb4177bb6924dab4a06.zip | |
std: Convert statics to constants
This commit repurposes most statics as constants in the standard library itself, with the exception of TLS keys which precisely have their own memory location as an implementation detail. This commit also rewrites the bitflags syntax to use `const` instead of `static`. All invocations will need to replace the word `static` with `const` when declaring flags. Due to the modification of the `bitflags!` syntax, this is a: [breaking-change]
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/posix.rs | 4 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index 196ac7507ea..f7fb9adb1fb 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -42,10 +42,10 @@ pub struct Path { } /// The standard path separator character -pub static SEP: char = '/'; +pub const SEP: char = '/'; /// The standard path separator byte -pub static SEP_BYTE: u8 = SEP as u8; +pub const SEP_BYTE: u8 = SEP as u8; /// Returns whether the given byte is a path separator #[inline] diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index ec3f87bc45a..5bd738ed58b 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -958,14 +958,14 @@ pub fn make_non_verbatim(path: &Path) -> Option<Path> { } /// The standard path separator character -pub static SEP: char = '\\'; +pub const SEP: char = '\\'; /// The standard path separator byte -pub static SEP_BYTE: u8 = SEP as u8; +pub const SEP_BYTE: u8 = SEP as u8; /// The alternative path separator character -pub static SEP2: char = '/'; +pub const SEP2: char = '/'; /// The alternative path separator character -pub static SEP2_BYTE: u8 = SEP2 as u8; +pub const SEP2_BYTE: u8 = SEP2 as u8; /// Returns whether the given char is a path separator. /// Allows both the primary separator '\' and the alternative separator '/'. |
