Skip to content

Commit

Permalink
Run cargo clippy (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc authored Nov 12, 2023
1 parent 382ee16 commit 6b4a6fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/sys/syscall/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn dispatcher(n: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize)
let buf_len = arg3;
let buf = unsafe { core::slice::from_raw_parts_mut(buf_ptr, buf_len) };
if let Ok(addr) = service::accept(handle) {
buf[0..buf_len].clone_from_slice(&addr.as_bytes());
buf[0..buf_len].clone_from_slice(addr.as_bytes());
0
} else {
-1 as isize as usize
Expand Down
2 changes: 1 addition & 1 deletion src/usr/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub fn main(args: &[&str]) -> Result<(), ExitCode> {
print!("{}", csi_reset);
}
let req = req.join("");
syscall::write(handle, &req.as_bytes());
syscall::write(handle, req.as_bytes());

let mut response_state = ResponseState::Headers;
loop {
Expand Down
4 changes: 2 additions & 2 deletions src/usr/lisp/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ pub fn lisp_slice(args: &[Exp]) -> Result<Exp, Err> {
};
match &args[0] {
Exp::List(l) => {
let l: Vec<Exp> = l.iter().skip(a).cloned().take(b).collect();
let l: Vec<Exp> = l.iter().skip(a).take(b).cloned().collect();
Ok(Exp::List(l))
}
Exp::Str(s) => {
Expand Down Expand Up @@ -413,7 +413,7 @@ pub fn lisp_file_size(args: &[Exp]) -> Result<Exp, Err> {
let path = string(&args[0])?;
match syscall::info(&path) {
Some(info) => Ok(Exp::Num(Number::from(info.size() as usize))),
None => return could_not!("open file"),
None => could_not!("open file"),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/usr/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn main(args: &[&str]) -> Result<(), ExitCode> {
if let Some((h, _)) = syscall::poll(&list) {
if h == stdin {
let line = io::stdin().read_line().replace("\n", "\r\n");
syscall::write(handle, &line.as_bytes());
syscall::write(handle, line.as_bytes());
} else {
let mut data = vec![0; buf_len];
if let Some(bytes) = syscall::read(handle, &mut data) {
Expand Down

0 comments on commit 6b4a6fa

Please sign in to comment.