Use !is_empty instead of length check (len_zero)

This commit is contained in:
ice_iix 2020-07-02 17:25:55 -07:00
parent 113abefd80
commit 7f5ab06c34
2 changed files with 6 additions and 2 deletions

View File

@ -502,7 +502,7 @@ impl super::Screen for ServerList {
}
let sm =
format!("{} mods + {}", res.forge_mods.len(), res.protocol_name);
let st = if res.forge_mods.len() > 0 {
let st = if !res.forge_mods.is_empty() {
&sm
} else {
&res.protocol_name

View File

@ -112,7 +112,11 @@ impl Server {
) -> Result<Server, protocol::Error> {
let mut conn = protocol::Conn::new(address, protocol_version)?;
let tag = if forge_mods.len() != 0 { "\0FML\0" } else { "" };
let tag = if !forge_mods.is_empty() {
"\0FML\0"
} else {
""
};
let host = conn.host.clone() + tag;
let port = conn.port;
conn.write_packet(protocol::packet::handshake::serverbound::Handshake {