about summary refs log tree commit diff
path: root/library/std/src/sys/wasi/stdio.rs
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2020-08-20 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2020-08-21 13:17:20 +0200
commit479c23bb493e4ea801c125cfc54e70723a9aeeb5 (patch)
tree0e55f5ac72d4f5665022c17811801add186e7160 /library/std/src/sys/wasi/stdio.rs
parent32cb8d40eb4382bd67510c0f06fc855063f0fde8 (diff)
downloadrust-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/wasi/stdio.rs')
-rw-r--r--library/std/src/sys/wasi/stdio.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/std/src/sys/wasi/stdio.rs b/library/std/src/sys/wasi/stdio.rs
index 78e3911dc4e..cc27e2ee583 100644
--- a/library/std/src/sys/wasi/stdio.rs
+++ b/library/std/src/sys/wasi/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
     }
 
     #[inline]
@@ -33,8 +33,8 @@ impl io::Read for Stdin {
 }
 
 impl Stdout {
-    pub fn new() -> io::Result<Stdout> {
-        Ok(Stdout)
+    pub fn new() -> Stdout {
+        Stdout
     }
 
     #[inline]
@@ -62,8 +62,8 @@ impl io::Write for Stdout {
 }
 
 impl Stderr {
-    pub fn new() -> io::Result<Stderr> {
-        Ok(Stderr)
+    pub fn new() -> Stderr {
+        Stderr
     }
 
     #[inline]
@@ -98,5 +98,5 @@ pub fn is_ebadf(err: &io::Error) -> bool {
 }
 
 pub fn panic_output() -> Option<impl io::Write> {
-    Stderr::new().ok()
+    Some(Stderr::new())
 }