chore: fix warnings

This commit is contained in:
Michel de Graaf
2025-06-29 17:56:23 +02:00
parent 430bdebb23
commit c654f7dcdb
8 changed files with 51 additions and 59 deletions
+8 -8
View File
@@ -79,19 +79,19 @@ impl Client {
println!("Logging in as {}", self.username);
if let Some(server) = &self.server {
let result = server.login(&self.username, &self.password);
if result.unwrap() == true {
return Ok(true);
if result.unwrap() {
Ok(true)
} else {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Error logging in",
));
))
}
} else {
return Err(std::io::Error::new(
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"Not connected to server",
));
))
}
}
@@ -99,8 +99,8 @@ impl Client {
println!("Searching for {}", query);
if let Some(server) = &self.server {
let hash = md5::md5(query);
let token = i32::from_str_radix(&hash[0..5].to_string(), 16).unwrap();
server.file_search(token, &query);
let token = i32::from_str_radix(&hash[0..5], 16).unwrap();
server.file_search(token, query);
} else {
eprintln!("Not connected to server");
}