[Crate] Apply cargo clippy fixes

This commit is contained in:
CosminPerRam 2023-05-30 15:49:35 +03:00
parent d302d1173f
commit 0ceb31bf86
2 changed files with 3 additions and 3 deletions

View file

@ -9,7 +9,7 @@ use std::net::IpAddr;
fn main() -> GDResult<()> { fn main() -> GDResult<()> {
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();
if args.len() == 1 || args[1] == "help".to_string() { if args.len() == 1 || args[1] == *"help" {
println!("Usage: <game> <ip> <port>"); println!("Usage: <game> <ip> <port>");
println!(" <game> - any game, example: tf2"); println!(" <game> - any game, example: tf2");
println!(" <ip> - an ip, example: 192.168.0.0"); println!(" <ip> - an ip, example: 192.168.0.0");
@ -23,7 +23,7 @@ fn main() -> GDResult<()> {
let ip = &args[2].as_str().parse::<IpAddr>().unwrap(); let ip = &args[2].as_str().parse::<IpAddr>().unwrap();
let port = match args.len() == 4 { let port = match args.len() == 4 {
false => { false => {
if args[1].starts_with("_") { if args[1].starts_with('_') {
panic!("The port must be specified with an anonymous query.") panic!("The port must be specified with an anonymous query.")
} }

View file

@ -62,7 +62,7 @@ mod tests {
#[test] #[test]
fn test_gdresult_err() { fn test_gdresult_err() {
let result: GDResult<u32> = Err(GDError::InvalidInput); let result: GDResult<u32> = Err(GDError::InvalidInput);
assert_eq!(result.is_err(), true); assert!(result.is_err());
} }
// Testing the Display trait for the GDError type // Testing the Display trait for the GDError type