summaryrefslogtreecommitdiffstats
path: root/safe_libc/src/stdio.rs
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-05-01 18:46:23 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2020-05-01 22:16:38 +0200
commitfd2384b7fab14732efde99da8affd830e2334e16 (patch)
treea17111e3363c457ec727b52023212c113d8304f6 /safe_libc/src/stdio.rs
parent5b449f4e1e43bc59109da5a37edf5ec911d3df8e (diff)
downloadneco-fd2384b7fab14732efde99da8affd830e2334e16.tar
neco-fd2384b7fab14732efde99da8affd830e2334e16.zip
Nightly stuff
Diffstat (limited to 'safe_libc/src/stdio.rs')
-rw-r--r--safe_libc/src/stdio.rs17
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)
}
}