Skip to content

Commit

Permalink
Fix lingering clippy issues (#1770)
Browse files Browse the repository at this point in the history
  • Loading branch information
pronebird authored Dec 10, 2024
1 parent 7fe6c2e commit 1a27e31
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ impl Gateway {
}

pub fn is_two_letter_iso_country_code(&self, code: &str) -> bool {
self.two_letter_iso_country_code()
.map_or(false, |gw_code| gw_code == code)
self.two_letter_iso_country_code() == Some(code)
}

pub fn has_ipr_address(&self) -> bool {
Expand Down Expand Up @@ -352,7 +351,7 @@ impl GatewayList {
self.gateways.iter().filter(move |gateway| {
gateway
.two_letter_iso_country_code()
.map_or(false, |gw_code| gw_code == code)
.is_some_and(|gw_code| gw_code == code)
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ProbeResult {
pub fn is_fully_operational_exit(&self) -> bool {
self.outcome.as_entry.can_connect
&& self.outcome.as_entry.can_route
&& self.outcome.as_exit.as_ref().map_or(false, |exit| {
&& self.outcome.as_exit.as_ref().is_some_and(|exit| {
exit.can_connect
&& exit.can_route_ip_v4
&& exit.can_route_ip_external_v4
Expand Down
2 changes: 1 addition & 1 deletion nym-vpn-core/crates/nym-vpn-api-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ nym-config.workspace = true
nym-contracts-common.workspace = true
nym-credential-proxy-requests.workspace = true
nym-credentials-interface.workspace = true
nym-crypto = { workspace = true, features = ["asymmetric"] }
nym-crypto = { workspace = true, features = ["asymmetric", "stream_cipher"] }
nym-ecash-time.workspace = true
nym-http-api-client.workspace = true
nym-validator-client.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion nym-vpn-core/crates/nym-vpn-api-client/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl ProbeOutcome {
pub fn is_fully_operational_exit(&self) -> bool {
self.as_entry.can_connect
&& self.as_entry.can_route
&& self.as_exit.as_ref().map_or(false, |exit| {
&& self.as_exit.as_ref().is_some_and(|exit| {
exit.can_connect
&& exit.can_route_ip_v4
&& exit.can_route_ip_external_v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ impl fmt::Display for SystemMessage {
impl SystemMessage {
pub fn is_current(&self) -> bool {
let now = OffsetDateTime::now_utc();
self.display_from.map_or(true, |from| from <= now)
&& self.display_until.map_or(true, |until| until >= now)
self.display_from.is_none_or(|from| from <= now)
&& self.display_until.is_none_or(|until| until >= now)
}
}

Expand Down

0 comments on commit 1a27e31

Please sign in to comment.