Skip to content

Commit

Permalink
chore: apply 1.84 linter suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuczyn committed Jan 10, 2025
1 parent a94c035 commit 7acac80
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 19 deletions.
2 changes: 1 addition & 1 deletion common/client-core/src/init/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ where
Ok(GatewayWithLatency::new(gateway, avg))
}

pub async fn choose_gateway_by_latency<'a, R: Rng, G: ConnectableGateway + Clone>(
pub async fn choose_gateway_by_latency<R: Rng, G: ConnectableGateway + Clone>(
rng: &mut R,
gateways: &[G],
must_use_tls: bool,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use futures::{Sink, Stream};
use rand::{CryptoRng, RngCore};
use tungstenite::Message as WsMessage;

impl<'a, S, R> State<'a, S, R> {
impl<S, R> State<'_, S, R> {
async fn client_handshake_inner(&mut self) -> Result<(), HandshakeError>
where
S: Stream<Item = WsItem> + Sink<WsMessage> + Unpin,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::registration::handshake::{error::HandshakeError, WsItem};
use futures::{Sink, Stream};
use tungstenite::Message as WsMessage;

impl<'a, S, R> State<'a, S, R> {
impl<S, R> State<'_, S, R> {
async fn gateway_handshake_inner(
&mut self,
raw_init_message: Vec<u8>,
Expand Down
5 changes: 1 addition & 4 deletions common/nym_offline_compact_ecash/src/scheme/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ pub fn aggregate_signatures(
let params = ecash_group_parameters();
// aggregate the signature

let signature = match Aggregatable::aggregate(signatures, indices) {
Ok(res) => res,
Err(err) => return Err(err),
};
let signature = Aggregatable::aggregate(signatures, indices)?;

// Ensure the aggregated signature is not an infinity point
if bool::from(signature.is_at_infinity()) {
Expand Down
4 changes: 2 additions & 2 deletions common/statistics/src/clients/packet_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ impl PacketStatisticsControl {
while self
.history
.front()
.map_or(false, |&(t, _)| t < recording_window)
.is_some_and(|&(t, _)| t < recording_window)
{
self.history.pop_front();
}
Expand Down Expand Up @@ -462,7 +462,7 @@ impl PacketStatisticsControl {
while self
.rates
.front()
.map_or(false, |&(t, _)| t < recording_window)
.is_some_and(|&(t, _)| t < recording_window)
{
self.rates.pop_front();
}
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/gateways/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ impl ThreadsafeGatewayCache {
.read()
.await
.get(&identity_key)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_locations(&self) -> GatewayLocationCache {
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/mix_nodes/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ impl ThreadsafeMixNodesCache {
.read()
.await
.get(&mix_id)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_locations(&self) -> MixnodeLocationCache {
Expand Down
4 changes: 1 addition & 3 deletions explorer-api/src/unstable/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ impl ThreadSafeNymNodesCache {
.read()
.await
.get(&node_id)
.map_or(false, |cache_item| {
cache_item.valid_until > SystemTime::now()
})
.is_some_and(|cache_item| cache_item.valid_until > SystemTime::now())
}

pub(crate) async fn get_bonded_nymnodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ pub(crate) struct ChainWritePermit<'a> {
inner: RwLockWriteGuard<'a, DirectSigningHttpRpcNyxdClient>,
}

impl<'a> ChainWritePermit<'a> {
impl ChainWritePermit<'_> {
pub(crate) async fn make_deposits(
self,
short_sha: &'static str,
Expand Down

0 comments on commit 7acac80

Please sign in to comment.