diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-08-20 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-08-21 13:17:20 +0200 |
| commit | 4a00421ba4daae419d06b67bd1bb46d7930b0dc7 (patch) | |
| tree | d047e2c2fce8a6171532a1671e1363227bbd4eed /library/std/src/sys/windows | |
| parent | 479c23bb493e4ea801c125cfc54e70723a9aeeb5 (diff) | |
| download | rust-4a00421ba4daae419d06b67bd1bb46d7930b0dc7.tar.gz rust-4a00421ba4daae419d06b67bd1bb46d7930b0dc7.zip | |
Make raw standard stream constructors const
Diffstat (limited to 'library/std/src/sys/windows')
| -rw-r--r-- | library/std/src/sys/windows/stdio.rs | 6 | ||||
| -rw-r--r-- | library/std/src/sys/windows/stdio_uwp.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs index b2e5458c0d2..ff214497166 100644 --- a/library/std/src/sys/windows/stdio.rs +++ b/library/std/src/sys/windows/stdio.rs @@ -131,7 +131,7 @@ fn write_u16s(handle: c::HANDLE, data: &[u16]) -> io::Result<usize> { } impl Stdin { - pub fn new() -> Stdin { + pub const fn new() -> Stdin { Stdin { surrogate: 0 } } } @@ -255,7 +255,7 @@ fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { } impl Stdout { - pub fn new() -> Stdout { + pub const fn new() -> Stdout { Stdout } } @@ -271,7 +271,7 @@ impl io::Write for Stdout { } impl Stderr { - pub fn new() -> Stderr { + pub const fn new() -> Stderr { Stderr } } diff --git a/library/std/src/sys/windows/stdio_uwp.rs b/library/std/src/sys/windows/stdio_uwp.rs index 0016f5dcd01..872511af862 100644 --- a/library/std/src/sys/windows/stdio_uwp.rs +++ b/library/std/src/sys/windows/stdio_uwp.rs @@ -30,7 +30,7 @@ fn write(handle_id: c::DWORD, data: &[u8]) -> io::Result<usize> { } impl Stdin { - pub fn new() -> Stdin { + pub const fn new() -> Stdin { Stdin {} } } @@ -44,7 +44,7 @@ impl io::Read for Stdin { } impl Stdout { - pub fn new() -> Stdout { + pub const fn new() -> Stdout { Stdout } } @@ -60,7 +60,7 @@ impl io::Write for Stdout { } impl Stderr { - pub fn new() -> Stderr { + pub const fn new() -> Stderr { Stderr } } |
