Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 8d8fc60

Browse files
committed
Code formatting
1 parent 4e77e2f commit 8d8fc60

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ fn main() {
1111
fs::copy(
1212
format!("bin/{}.a", target),
1313
out_dir.join(format!("lib{}.a", name)),
14-
).unwrap();
14+
)
15+
.unwrap();
1516

1617
println!("cargo:rustc-link-lib=static={}", name);
1718
println!("cargo:rustc-link-search={}", out_dir.display());

src/hio.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Host I/O
22
3-
use core::{fmt, slice};
43
use crate::nr;
4+
use core::{fmt, slice};
55

66
/// Host's standard error
77
#[derive(Clone, Copy)]
@@ -57,8 +57,7 @@ pub fn hstdout() -> Result<HStdout, ()> {
5757

5858
fn open(name: &str, mode: usize) -> Result<usize, ()> {
5959
let name = name.as_bytes();
60-
match unsafe { syscall!(OPEN, name.as_ptr(), mode, name.len() - 1) } as
61-
isize {
60+
match unsafe { syscall!(OPEN, name.as_ptr(), mode, name.len() - 1) } as isize {
6261
-1 => Err(()),
6362
fd => Ok(fd as usize),
6463
}
@@ -72,9 +71,7 @@ fn write_all(fd: usize, mut buffer: &[u8]) -> Result<(), ()> {
7271
// `n` bytes were not written
7372
n if n <= buffer.len() => {
7473
let offset = (buffer.len() - n) as isize;
75-
buffer = unsafe {
76-
slice::from_raw_parts(buffer.as_ptr().offset(offset), n)
77-
}
74+
buffer = unsafe { slice::from_raw_parts(buffer.as_ptr().offset(offset), n) }
7875
}
7976
#[cfg(feature = "jlink-quirks")]
8077
// Error (-1) - should be an error but JLink can return -1, -2, -3,...

src/macros.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ macro_rules! syscall {
1111
$crate::syscall($crate::nr::$nr, &[$a1 as usize, $a2 as usize])
1212
};
1313
($nr:ident, $a1:expr, $a2:expr, $a3:expr) => {
14-
$crate::syscall($crate::nr::$nr, &[$a1 as usize, $a2 as usize,
15-
$a3 as usize])
14+
$crate::syscall($crate::nr::$nr, &[$a1 as usize, $a2 as usize, $a3 as usize])
1615
};
1716
($nr:ident, $a1:expr, $a2:expr, $a3:expr, $a4:expr) => {
18-
$crate::syscall($crate::nr::$nr, &[$a1 as usize, $a2 as usize,
19-
$a3 as usize, $a4 as usize])
17+
$crate::syscall(
18+
$crate::nr::$nr,
19+
&[$a1 as usize, $a2 as usize, $a3 as usize, $a4 as usize],
20+
)
2021
};
2122
}
2223

0 commit comments

Comments
 (0)