diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2020-05-01 18:46:23 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2020-05-01 22:16:38 +0200 |
commit | fd2384b7fab14732efde99da8affd830e2334e16 (patch) | |
tree | a17111e3363c457ec727b52023212c113d8304f6 /safe_libc/src/stdio.rs | |
parent | 5b449f4e1e43bc59109da5a37edf5ec911d3df8e (diff) | |
download | neco-fd2384b7fab14732efde99da8affd830e2334e16.tar neco-fd2384b7fab14732efde99da8affd830e2334e16.zip |
Nightly stuff
Diffstat (limited to 'safe_libc/src/stdio.rs')
-rw-r--r-- | safe_libc/src/stdio.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/safe_libc/src/stdio.rs b/safe_libc/src/stdio.rs index 2d19725..be016ab 100644 --- a/safe_libc/src/stdio.rs +++ b/safe_libc/src/stdio.rs @@ -41,28 +41,17 @@ pub fn stderr() -> Stderr { impl BasicOStream { #[inline] pub fn flush(&mut self) -> Result<()> { - check_io(unsafe { - libc::fflush(self.0) - } == 0) + check_io(unsafe { libc::fflush(self.0) } == 0) } #[inline] pub fn write(&mut self, b: &[u8]) -> Result<()> { - check_io(unsafe { - libc::fwrite( - b.as_ptr().cast(), - 1, - b.len(), - self.0, - ) - } == b.len()) + check_io(unsafe { libc::fwrite(b.as_ptr().cast(), 1, b.len(), self.0) } == b.len()) } #[inline] pub fn puts(&mut self, s: &string::CStr) -> Result<()> { - check_io(unsafe { - libc::fputs(s.as_ptr(), self.0) - } != libc::EOF) + check_io(unsafe { libc::fputs(s.as_ptr(), self.0) } != libc::EOF) } } |