More clippy fixin's.

This commit is contained in:
2021-12-31 10:32:15 -08:00
parent 8ac3f52546
commit aa414fd527
4 changed files with 13 additions and 13 deletions

View File

@@ -97,7 +97,7 @@ impl Arbitrary for ClientConnectionCommand {
ClientConnectionCommand::EstablishTCPPortBinding,
ClientConnectionCommand::AssociateUDPPort,
];
g.choose(&options).unwrap().clone()
*g.choose(&options).unwrap()
}
}
@@ -164,8 +164,8 @@ fn short_write_fails_right() {
let mut cursor = Cursor::new(&mut buffer as &mut [u8]);
let result = task::block_on(cmd.write(&mut cursor));
match result {
Ok(_) => assert!(false, "Mysteriously able to fit > 2 bytes in 2 bytes."),
Ok(_) => panic!("Mysteriously able to fit > 2 bytes in 2 bytes."),
Err(SerializationError::IOError(x)) => assert_eq!(ErrorKind::WriteZero, x.kind()),
Err(e) => assert!(false, "Got the wrong error writing too much data: {}", e),
Err(e) => panic!("Got the wrong error writing too much data: {}", e),
}
}

View File

@@ -200,8 +200,8 @@ fn short_write_fails_right() {
let mut cursor = Cursor::new(&mut buffer as &mut [u8]);
let result = task::block_on(cmd.write(&mut cursor));
match result {
Ok(_) => assert!(false, "Mysteriously able to fit > 2 bytes in 2 bytes."),
Ok(_) => panic!("Mysteriously able to fit > 2 bytes in 2 bytes."),
Err(SerializationError::IOError(x)) => assert_eq!(ErrorKind::WriteZero, x.kind()),
Err(e) => assert!(false, "Got the wrong error writing too much data: {}", e),
Err(e) => panic!("Got the wrong error writing too much data: {}", e),
}
}

View File

@@ -9,7 +9,7 @@ pub fn arbitrary_socks_string(g: &mut Gen) -> String {
potential.truncate(255);
let bytestring = potential.as_bytes();
if bytestring.len() > 0 && bytestring.len() < 256 {
if !bytestring.is_empty() && bytestring.len() < 256 {
return potential;
}
}