1
5
mirror of https://github.com/vinc/moros.git synced 2024-06-25 18:37:04 +00:00

Run cargo clippy (#541)

This commit is contained in:
Vincent Ollivier 2023-11-12 18:34:41 +01:00 committed by GitHub
parent 382ee16dcc
commit 6b4a6fa092
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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) => {
@ -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"),
}
}

View File

@ -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) {