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 | 479c23bb493e4ea801c125cfc54e70723a9aeeb5 (patch) | |
| tree | 0e55f5ac72d4f5665022c17811801add186e7160 /library/std/src/sys/windows | |
| parent | 32cb8d40eb4382bd67510c0f06fc855063f0fde8 (diff) | |
| download | rust-479c23bb493e4ea801c125cfc54e70723a9aeeb5.tar.gz rust-479c23bb493e4ea801c125cfc54e70723a9aeeb5.zip | |
Remove result type from raw standard streams constructors
Raw standard streams constructors are infallible. Remove unnecessary result type.
Diffstat (limited to 'library/std/src/sys/windows')
| -rw-r--r-- | library/std/src/sys/windows/stdio.rs | 14 | ||||
| -rw-r--r-- | library/std/src/sys/windows/stdio_uwp.rs | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/library/std/src/sys/windows/stdio.rs b/library/std/src/sys/windows/stdio.rs index c84896296ec..b2e5458c0d2 100644 --- a/library/std/src/sys/windows/stdio.rs +++ b/library/std/src/sys/windows/stdio.rs @@ -131,8 +131,8 @@ fn write_u16s(handle: c::HANDLE, data: &[u16]) -> io::Result<usize> { } impl Stdin { - pub fn new() -> io::Result<Stdin> { - Ok(Stdin { surrogate: 0 }) + pub fn new() -> Stdin { + Stdin { surrogate: 0 } } } @@ -255,8 +255,8 @@ fn utf16_to_utf8(utf16: &[u16], utf8: &mut [u8]) -> io::Result<usize> { } impl Stdout { - pub fn new() -> io::Result<Stdout> { - Ok(Stdout) + pub fn new() -> Stdout { + Stdout } } @@ -271,8 +271,8 @@ impl io::Write for Stdout { } impl Stderr { - pub fn new() -> io::Result<Stderr> { - Ok(Stderr) + pub fn new() -> Stderr { + Stderr } } @@ -291,5 +291,5 @@ pub fn is_ebadf(err: &io::Error) -> bool { } pub fn panic_output() -> Option<impl io::Write> { - Stderr::new().ok() + Some(Stderr::new()) } diff --git a/library/std/src/sys/windows/stdio_uwp.rs b/library/std/src/sys/windows/stdio_uwp.rs index 5bdabf6d4b7..0016f5dcd01 100644 --- a/library/std/src/sys/windows/stdio_uwp.rs +++ b/library/std/src/sys/windows/stdio_uwp.rs @@ -30,8 +30,8 @@ fn write(handle_id: c::DWORD, data: &[u8]) -> io::Result<usize> { } impl Stdin { - pub fn new() -> io::Result<Stdin> { - Ok(Stdin {}) + pub fn new() -> Stdin { + Stdin {} } } @@ -44,8 +44,8 @@ impl io::Read for Stdin { } impl Stdout { - pub fn new() -> io::Result<Stdout> { - Ok(Stdout) + pub fn new() -> Stdout { + Stdout } } @@ -60,8 +60,8 @@ impl io::Write for Stdout { } impl Stderr { - pub fn new() -> io::Result<Stderr> { - Ok(Stderr) + pub fn new() -> Stderr { + Stderr } } @@ -80,5 +80,5 @@ pub fn is_ebadf(err: &io::Error) -> bool { } pub fn panic_output() -> Option<impl io::Write> { - Stderr::new().ok() + Some(Stderr::new()) } |
