summaryrefslogtreecommitdiffstats
path: root/safe_libc/src/stdio.rs
diff options
context:
space:
mode:
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)
}
}