diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-06-12 14:43:22 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-06-12 15:17:07 +0200 |
| commit | 57da9f8609a955dee1da95e7a4f0bc30976134f8 (patch) | |
| tree | 7513c7b7dcf2550cfe8802d333f663a788561d79 /mullvad-cli/src | |
| parent | fdf7e2f9c724649748adc49948994a9436bd3a2a (diff) | |
| download | mullvadvpn-57da9f8609a955dee1da95e7a4f0bc30976134f8.tar.xz mullvadvpn-57da9f8609a955dee1da95e7a4f0bc30976134f8.zip | |
Fix various things clippy pointed out in CLI
Diffstat (limited to 'mullvad-cli/src')
| -rw-r--r-- | mullvad-cli/src/cmds/relay.rs | 2 | ||||
| -rw-r--r-- | mullvad-cli/src/cmds/tunnel.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mullvad-cli/src/cmds/relay.rs b/mullvad-cli/src/cmds/relay.rs index 965107057d..c9bf61be43 100644 --- a/mullvad-cli/src/cmds/relay.rs +++ b/mullvad-cli/src/cmds/relay.rs @@ -222,7 +222,7 @@ impl Relay { let mut private_key_str = String::new(); println!("Reading private key from standard input"); let _ = io::stdin().lock().read_line(&mut private_key_str); - if private_key_str.trim().len() == 0 { + if private_key_str.trim().is_empty() { eprintln!("Expected to read private key from standard input"); } let private_key = Self::validate_wireguard_key(&private_key_str).into(); diff --git a/mullvad-cli/src/cmds/tunnel.rs b/mullvad-cli/src/cmds/tunnel.rs index 136290d5bb..7eacdddb78 100644 --- a/mullvad-cli/src/cmds/tunnel.rs +++ b/mullvad-cli/src/cmds/tunnel.rs @@ -134,7 +134,7 @@ impl Tunnel { .wireguard .mtu .map(|mtu| mtu.to_string()) - .unwrap_or("unset".into()) + .unwrap_or_else(|| "unset".to_owned()) ); Ok(()) } @@ -193,7 +193,7 @@ impl Tunnel { tunnel_options .openvpn .mssfix - .map_or_else(|| "unset".to_string(), |v| v.to_string()) + .map_or_else(|| "unset".to_owned(), |v| v.to_string()) ); Ok(()) } |
