Skip to content

Commit 82f40c4

Browse files
committed
minor changes to follow the Rust's style guidelines
1 parent c1e440a commit 82f40c4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/libstd/sys/hermit/fs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ impl OpenOptions {
226226
(true, true, false) => Ok(O_RDWR),
227227
(false, _, true) => Ok(O_WRONLY | O_APPEND),
228228
(true, _, true) => Ok(O_RDWR | O_APPEND),
229-
(false, false, false) => Err(io::Error::new(ErrorKind::InvalidInput, "invalid access mode")),
229+
(false, false, false) => {
230+
Err(io::Error::new(ErrorKind::InvalidInput, "invalid access mode"))
231+
},
230232
}
231233
}
232234

src/libstd/sys/hermit/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub unsafe fn abort_internal() -> ! {
8181
sys_abort();
8282
}
8383

84-
// TODO: just a workaround to test the system
84+
// FIXME: just a workaround to test the system
8585
pub fn hashmap_random_keys() -> (u64, u64) {
8686
(1, 2)
8787
}
@@ -104,7 +104,8 @@ pub fn init() {
104104

105105
#[cfg(not(test))]
106106
#[no_mangle]
107-
pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char, env: *const *const c_char) -> ! {
107+
pub unsafe extern "C" fn runtime_entry(argc: i32, argv: *const *const c_char,
108+
env: *const *const c_char) -> ! {
108109
extern "C" {
109110
fn main(argc: isize, argv: *const *const c_char) -> i32;
110111
fn sys_exit(arg: i32) ->!;

src/libstd/sys/hermit/thread.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ pub const NORMAL_PRIO: Priority = Priority::from(2);
3535

3636
extern "C" {
3737
fn sys_usleep(usecs: u64);
38-
fn sys_spawn(id: *mut Tid, func: extern "C" fn(usize), arg: usize, prio: u8, core_id: isize) -> i32;
38+
fn sys_spawn(id: *mut Tid, func: extern "C" fn(usize),
39+
arg: usize, prio: u8, core_id: isize) -> i32;
3940
fn sys_join(id: Tid) -> i32;
4041
fn sys_yield();
4142
}
@@ -55,7 +56,8 @@ impl Thread {
5556
{
5657
let p = box p;
5758
let mut tid: Tid = u32::MAX;
58-
let ret = sys_spawn(&mut tid as *mut Tid, thread_start, &*p as *const _ as *const u8 as usize,
59+
let ret = sys_spawn(&mut tid as *mut Tid, thread_start,
60+
&*p as *const _ as *const u8 as usize,
5961
Priority::into(NORMAL_PRIO), core_id);
6062

6163
return if ret == 0 {

0 commit comments

Comments
 (0)