Skip to content

Commit 0377355

Browse files
committed
remove some clippy warnings
+ revert obsolete changes
1 parent 6608ae2 commit 0377355

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

examples/demo/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ fn main() -> io::Result<()> {
1818
thread::spawn()?;
1919
fs::fs()?;
2020
pi::pi();
21-
//matmul::matmul();
22-
//laplace::laplace();
21+
matmul::matmul();
22+
laplace::laplace();
2323
mandelbrot::mandelbrot();
2424
Ok(())
2525
}

examples/fork/src/main.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,21 @@ fn fork_bench(count: usize) -> Duration {
99
let mut pids = vec![Pid::default(); count]; // Pre-allocate with zeros
1010

1111
let start = Instant::now();
12-
for i in 0..count {
13-
let pid = unsafe { fork() };
12+
for pid in pids.iter_mut().take(count) {
13+
*pid = unsafe { fork() };
1414

15-
if pid == 0 {
15+
if *pid == 0 {
1616
exit(0);
1717
}
18-
pids[i] = pid;
1918
}
2019

2120
for pid in &pids {
2221
unsafe {
2322
waitpid(*pid);
2423
}
2524
}
26-
let elapsed = start.elapsed();
2725

28-
elapsed
26+
start.elapsed()
2927
}
3028

3129
fn main() {

hermit/src/syscall/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub extern "C" fn sys_spawn(
208208
prio: u8,
209209
core_id: isize,
210210
) -> i32 {
211-
let result: i32 = syscall!(SyscallNo::Spawn, id, func, arg, prio, core_id)
211+
let result: i32 = syscall!(SyscallNo::Spawn, id, func as usize, arg, prio, core_id)
212212
.try_into()
213213
.unwrap();
214214
update_errno!(result);
@@ -223,7 +223,7 @@ pub extern "C" fn sys_spawn2(
223223
stack_size: usize,
224224
core_id: isize,
225225
) -> abi::Tid {
226-
syscall!(SyscallNo::Spawn2, func, arg, prio, stack_size, core_id)
226+
syscall!(SyscallNo::Spawn2, func as usize, arg, prio, stack_size, core_id)
227227
.try_into()
228228
.unwrap()
229229
}

0 commit comments

Comments
 (0)