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/unix/stdio.rs | |
parent | 32cb8d40eb4382bd67510c0f06fc855063f0fde8 (diff) | |
download | rust-479c23bb493e4ea801c125cfc54e70723a9aeeb5.tar.gz |
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/unix/stdio.rs')
-rw-r--r-- | library/std/src/sys/unix/stdio.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/std/src/sys/unix/stdio.rs b/library/std/src/sys/unix/stdio.rs index f8353214cbc..bbf5dd65fa5 100644 --- a/library/std/src/sys/unix/stdio.rs +++ b/library/std/src/sys/unix/stdio.rs @@ -7,8 +7,8 @@ pub struct Stdout(()); pub struct Stderr(()); impl Stdin { - pub fn new() -> io::Result<Stdin> { - Ok(Stdin(())) + pub fn new() -> Stdin { + Stdin(()) } } @@ -28,8 +28,8 @@ impl io::Read for Stdin { } impl Stdout { - pub fn new() -> io::Result<Stdout> { - Ok(Stdout(())) + pub fn new() -> Stdout { + Stdout(()) } } @@ -53,8 +53,8 @@ impl io::Write for Stdout { } impl Stderr { - pub fn new() -> io::Result<Stderr> { - Ok(Stderr(())) + pub fn new() -> Stderr { + Stderr(()) } } @@ -84,5 +84,5 @@ pub fn is_ebadf(err: &io::Error) -> bool { pub const STDIN_BUF_SIZE: usize = crate::sys_common::io::DEFAULT_BUF_SIZE; pub fn panic_output() -> Option<impl io::Write> { - Stderr::new().ok() + Some(Stderr::new()) } |