mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-05-18 09:35:50 +00:00
[Crate] Apply cargo clippy fixes
This commit is contained in:
parent
d302d1173f
commit
0ceb31bf86
2 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ use std::net::IpAddr;
|
|||
fn main() -> GDResult<()> {
|
||||
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!(" <game> - any game, example: tf2");
|
||||
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 port = match args.len() == 4 {
|
||||
false => {
|
||||
if args[1].starts_with("_") {
|
||||
if args[1].starts_with('_') {
|
||||
panic!("The port must be specified with an anonymous query.")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ mod tests {
|
|||
#[test]
|
||||
fn test_gdresult_err() {
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue