From 9b5a6eafc1f394d819636e60859b3c679b34ff50 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 26 Oct 2020 21:54:36 +0100 Subject: Format everything --- cortex-m-semihosting/src/hio.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cortex-m-semihosting/src/hio.rs') diff --git a/cortex-m-semihosting/src/hio.rs b/cortex-m-semihosting/src/hio.rs index b0ca2fb..b6b6c7b 100644 --- a/cortex-m-semihosting/src/hio.rs +++ b/cortex-m-semihosting/src/hio.rs @@ -1,7 +1,7 @@ //! Host I/O -use core::{fmt, slice}; use crate::nr; +use core::{fmt, slice}; /// A byte stream to the host (e.g., host's stdout or stderr). #[derive(Clone, Copy)] @@ -38,8 +38,7 @@ pub fn hstdout() -> Result { fn open(name: &str, mode: usize) -> Result { let name = name.as_bytes(); - match unsafe { syscall!(OPEN, name.as_ptr(), mode, name.len() - 1) } as - isize { + match unsafe { syscall!(OPEN, name.as_ptr(), mode, name.len() - 1) } as isize { -1 => Err(()), fd => Ok(HostStream { fd: fd as usize }), } @@ -53,9 +52,7 @@ fn write_all(fd: usize, mut buffer: &[u8]) -> Result<(), ()> { // `n` bytes were not written n if n <= buffer.len() => { let offset = (buffer.len() - n) as isize; - buffer = unsafe { - slice::from_raw_parts(buffer.as_ptr().offset(offset), n) - } + buffer = unsafe { slice::from_raw_parts(buffer.as_ptr().offset(offset), n) } } #[cfg(feature = "jlink-quirks")] // Error (-1) - should be an error but JLink can return -1, -2, -3,... -- cgit v1.2.3