Skip to content

Commit

Permalink
Merge pull request #4384 from iotaledger/chore/fix-needless_lifetimes…
Browse files Browse the repository at this point in the history
…-1.83
  • Loading branch information
thibault-martinez authored Dec 11, 2024
2 parents a1a17c4 + 5bd40ba commit b45cbce
Show file tree
Hide file tree
Showing 38 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion crates/iota-cluster-test/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct ClusterTestOpt {
#[allow(dead_code)]
struct ObfuscatedPgAddress<'a>(&'a Option<String>);

impl<'a> std::fmt::Display for ObfuscatedPgAddress<'a> {
impl std::fmt::Display for ObfuscatedPgAddress<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self.0 {
None => write!(f, "None"),
Expand Down
4 changes: 2 additions & 2 deletions crates/iota-common/src/sync/notify_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub struct Registration<'a, K: Eq + Hash + Clone, V: Clone> {
registration: Option<(K, oneshot::Receiver<V>)>,
}

impl<'a, K: Eq + Hash + Clone + Unpin, V: Clone + Unpin> Future for Registration<'a, K, V> {
impl<K: Eq + Hash + Clone + Unpin, V: Clone + Unpin> Future for Registration<'_, K, V> {
type Output = V;

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand All @@ -168,7 +168,7 @@ impl<'a, K: Eq + Hash + Clone + Unpin, V: Clone + Unpin> Future for Registration
}
}

impl<'a, K: Eq + Hash + Clone, V: Clone> Drop for Registration<'a, K, V> {
impl<K: Eq + Hash + Clone, V: Clone> Drop for Registration<'_, K, V> {
fn drop(&mut self) {
if let Some((key, receiver)) = self.registration.take() {
mem::drop(receiver);
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-core/src/consensus_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ impl<'a> InflightDropGuard<'a> {
}
}

impl<'a> Drop for InflightDropGuard<'a> {
impl Drop for InflightDropGuard<'_> {
fn drop(&mut self) {
self.adapter
.num_inflight_transactions
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-graphql-rpc/src/data/pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl QueryExecutor for PgExecutor {
}
}

impl<'c> super::DbConnection for PgConnection<'c> {
impl super::DbConnection for PgConnection<'_> {
type Connection = diesel::PgConnection;
type Backend = Pg;

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-indexer/src/handlers/tx_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl<'a> EpochEndIndexingObjectStore<'a> {
}
}

impl<'a> iota_types::storage::ObjectStore for EpochEndIndexingObjectStore<'a> {
impl iota_types::storage::ObjectStore for EpochEndIndexingObjectStore<'_> {
fn get_object(
&self,
object_id: &ObjectID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
IotaProgrammableTransactionBlock, displays::Pretty,
};

impl<'a> Display for Pretty<'a, IotaProgrammableTransactionBlock> {
impl Display for Pretty<'_, IotaProgrammableTransactionBlock> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(ptb) = self;
let IotaProgrammableTransactionBlock { inputs, commands } = ptb;
Expand Down Expand Up @@ -82,7 +82,7 @@ impl<'a> Display for Pretty<'a, IotaProgrammableTransactionBlock> {
}
}

impl<'a> Display for Pretty<'a, IotaCommand> {
impl Display for Pretty<'_, IotaCommand> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(command) = self;
match command {
Expand Down Expand Up @@ -141,7 +141,7 @@ impl<'a> Display for Pretty<'a, IotaCommand> {
}
}

impl<'a> Display for Pretty<'a, IotaProgrammableMoveCall> {
impl Display for Pretty<'_, IotaProgrammableMoveCall> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(move_call) = self;
let IotaProgrammableMoveCall {
Expand Down Expand Up @@ -170,7 +170,7 @@ impl<'a> Display for Pretty<'a, IotaProgrammableMoveCall> {
}
}

impl<'a> Display for Pretty<'a, IotaArgument> {
impl Display for Pretty<'_, IotaArgument> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(argument) = self;

Expand Down
4 changes: 2 additions & 2 deletions crates/iota-metrics/src/guards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a> GaugeGuard<'a> {
}
}

impl<'a> Drop for GaugeGuard<'a> {
impl Drop for GaugeGuard<'_> {
/// Decrements the value of the `IntGauge` when the `IntGaugeGuard` is
/// dropped.
fn drop(&mut self) {
Expand Down Expand Up @@ -56,7 +56,7 @@ pub struct GaugeGuardFuture<'a, F: Sized> {
_guard: GaugeGuard<'a>,
}

impl<'a, F: Future> Future for GaugeGuardFuture<'a, F> {
impl<F: Future> Future for GaugeGuardFuture<'_, F> {
type Output = F::Output;

/// Polls the wrapped future (`f`) to determine its readiness. This function
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-metrics/src/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ impl HistogramReporter {
}
}

impl<'a> Drop for HistogramTimerGuard<'a> {
impl Drop for HistogramTimerGuard<'_> {
/// Reports the elapsed time in milliseconds to the associated histogram
/// when the `HistogramTimerGuard` is dropped.
fn drop(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-metrics/src/metered_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<'a, T> Permit<'a, T> {
}
}

impl<'a, T> Drop for Permit<'a, T> {
impl<T> Drop for Permit<'_, T> {
/// Custom drop logic for the `Permit` to handle cases where the permit is
/// dropped without sending a value. This ensures that the occupancy of
/// the channel is correctly updated by decrementing the associated gauge
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-metrics/src/monitored_mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<'a, T> Permit<'a, T> {
}
}

impl<'a, T> Drop for Permit<'a, T> {
impl<T> Drop for Permit<'_, T> {
fn drop(&mut self) {
// In the case the permit is dropped without sending, we still want to decrease
// the occupancy of the channel. Otherwise, receiver should be
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-package-resolver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ impl OpenSignatureBody {
}
}

impl<'m, 'n> DatatypeRef<'m, 'n> {
impl DatatypeRef<'_, '_> {
pub fn as_key(&self) -> DatatypeKey {
DatatypeKey {
package: self.package,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-replay/src/displays/gas_status_displays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tabled::{

use crate::displays::Pretty;

impl<'a> Display for Pretty<'a, IotaGasStatus> {
impl Display for Pretty<'_, IotaGasStatus> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(iota_gas_status) = self;
match iota_gas_status {
Expand Down
12 changes: 6 additions & 6 deletions crates/iota-replay/src/displays/transaction_displays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct ResolvedResults {
/// These Display implementations provide alternate displays that are used to
/// format info contained in these Structs when calling the CLI replay command
/// with an additional provided flag.
impl<'a> Display for Pretty<'a, FullPTB> {
impl Display for Pretty<'_, FullPTB> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(full_ptb) = self;
let FullPTB { ptb, results } = full_ptb;
Expand Down Expand Up @@ -146,7 +146,7 @@ impl<'a> Display for Pretty<'a, FullPTB> {
}
}

impl<'a> Display for Pretty<'a, Command> {
impl Display for Pretty<'_, Command> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(command) = self;
match command {
Expand Down Expand Up @@ -201,7 +201,7 @@ impl<'a> Display for Pretty<'a, Command> {
}
}

impl<'a> Display for Pretty<'a, ProgrammableMoveCall> {
impl Display for Pretty<'_, ProgrammableMoveCall> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(move_call) = self;
let ProgrammableMoveCall {
Expand Down Expand Up @@ -231,7 +231,7 @@ impl<'a> Display for Pretty<'a, ProgrammableMoveCall> {
}
}

impl<'a> Display for Pretty<'a, Argument> {
impl Display for Pretty<'_, Argument> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(argument) = self;

Expand All @@ -244,7 +244,7 @@ impl<'a> Display for Pretty<'a, Argument> {
write!(f, "{}", output)
}
}
impl<'a> Display for Pretty<'a, ResolvedResults> {
impl Display for Pretty<'_, ResolvedResults> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(ResolvedResults {
mutable_reference_outputs,
Expand Down Expand Up @@ -283,7 +283,7 @@ impl<'a> Display for Pretty<'a, ResolvedResults> {
}
}

impl<'a> Display for Pretty<'a, TypeTag> {
impl Display for Pretty<'_, TypeTag> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(type_tag) = self;
match type_tag {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-transactional-test-runner/src/test_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ struct TxnSummary {
}

#[async_trait]
impl<'a> MoveTestAdapter<'a> for IotaTestAdapter {
impl MoveTestAdapter<'_> for IotaTestAdapter {
type ExtraPublishArgs = IotaPublishArgs;
type ExtraRunArgs = IotaRunArgs;
type ExtraInitArgs = IotaInitArgs;
Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/client_ptb/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ impl fmt::Display for ParsedPTBCommand {

struct TyDisplay<'a>(&'a ParsedType);

impl<'a> fmt::Display for TyDisplay<'a> {
impl fmt::Display for TyDisplay<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
use ParsedType::*;
match self.0 {
Expand Down
4 changes: 2 additions & 2 deletions crates/iota/src/client_ptb/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub enum Token {
Upgrade,
}

impl<'l> Lexeme<'l> {
impl Lexeme<'_> {
/// Returns true if this lexeme corresponds to a special error token.
pub fn is_error(&self) -> bool {
use Token as T;
Expand All @@ -84,7 +84,7 @@ impl<'l> Lexeme<'l> {
}
}

impl<'a> fmt::Display for Lexeme<'a> {
impl fmt::Display for Lexeme<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use Token as T;

Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/displays/dry_run_tx_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tabled::{
};

use crate::{client_commands::estimate_gas_budget_from_gas_cost, displays::Pretty};
impl<'a> Display for Pretty<'a, DryRunTransactionBlockResponse> {
impl Display for Pretty<'_, DryRunTransactionBlockResponse> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(response) = self;

Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/displays/gas_cost_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use iota_types::gas::GasCostSummary;

use crate::displays::Pretty;

impl<'a> Display for Pretty<'a, GasCostSummary> {
impl Display for Pretty<'_, GasCostSummary> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(gcs) = self;
let GasCostSummary {
Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/displays/ptb_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
sp,
};

impl<'a> Display for PTBPreview<'a> {
impl Display for PTBPreview<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut builder = TableBuilder::default();
let columns = vec!["command", "values"];
Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/displays/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use iota_json_rpc_types::IotaExecutionStatus::{self, Failure, Success};

use crate::displays::Pretty;

impl<'a> Display for Pretty<'a, IotaExecutionStatus> {
impl Display for Pretty<'_, IotaExecutionStatus> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let Pretty(status) = self;

Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/displays/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tabled::{

use crate::{client_ptb::ptb::Summary, displays::Pretty};

impl<'a> Display for Pretty<'a, Summary> {
impl Display for Pretty<'_, Summary> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut builder = TableBuilder::default();
let Pretty(summary) = self;
Expand Down
6 changes: 3 additions & 3 deletions crates/typed-store/src/rocks/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iter<'a, K, V> {
}
}

impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for Iter<'a, K, V> {
impl<K: DeserializeOwned, V: DeserializeOwned> Iterator for Iter<'_, K, V> {
type Item = (K, V);

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -94,7 +94,7 @@ impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for Iter<'a, K, V> {
}
}

impl<'a, K, V> Drop for Iter<'a, K, V> {
impl<K, V> Drop for Iter<'_, K, V> {
fn drop(&mut self) {
if let Some(bytes_scanned) = self.bytes_scanned.take() {
bytes_scanned.observe(self.bytes_scanned_counter as f64);
Expand Down Expand Up @@ -166,7 +166,7 @@ impl<'a, K, V> RevIter<'a, K, V> {
}
}

impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for RevIter<'a, K, V> {
impl<K: DeserializeOwned, V: DeserializeOwned> Iterator for RevIter<'_, K, V> {
type Item = (K, V);

/// Will give the next item backwards
Expand Down
4 changes: 2 additions & 2 deletions crates/typed-store/src/rocks/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<'a, K: DeserializeOwned> Keys<'a, K> {
}
}

impl<'a, K: DeserializeOwned> Iterator for Keys<'a, K> {
impl<K: DeserializeOwned> Iterator for Keys<'_, K> {
type Item = Result<K, TypedStoreError>;

fn next(&mut self) -> Option<Self::Item> {
Expand All @@ -44,7 +44,7 @@ impl<'a, K: DeserializeOwned> Iterator for Keys<'a, K> {
}
}

impl<'a, K: Serialize> Keys<'a, K> {
impl<K: Serialize> Keys<'_, K> {
/// Skips all the elements that are smaller than the given key,
/// and either lands on the key or the first one greater than
/// the key.
Expand Down
4 changes: 2 additions & 2 deletions crates/typed-store/src/rocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ pub enum RocksDBRawIter<'a> {
),
}

impl<'a> RocksDBRawIter<'a> {
impl RocksDBRawIter<'_> {
pub fn valid(&self) -> bool {
delegate_iter_call!(self.valid())
}
Expand Down Expand Up @@ -1835,7 +1835,7 @@ pub enum RocksDBIter<'a> {
),
}

impl<'a> Iterator for RocksDBIter<'a> {
impl Iterator for RocksDBIter<'_> {
type Item = Result<(Box<[u8]>, Box<[u8]>), Error>;
fn next(&mut self) -> Option<Self::Item> {
match self {
Expand Down
6 changes: 3 additions & 3 deletions crates/typed-store/src/rocks/safe_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a, K: DeserializeOwned, V: DeserializeOwned> SafeIter<'a, K, V> {
}
}

impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for SafeIter<'a, K, V> {
impl<K: DeserializeOwned, V: DeserializeOwned> Iterator for SafeIter<'_, K, V> {
type Item = Result<(K, V), TypedStoreError>;

fn next(&mut self) -> Option<Self::Item> {
Expand Down Expand Up @@ -95,7 +95,7 @@ impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for SafeIter<'a, K,
}
}

impl<'a, K, V> Drop for SafeIter<'a, K, V> {
impl<K, V> Drop for SafeIter<'_, K, V> {
fn drop(&mut self) {
if let Some(bytes_scanned) = self.bytes_scanned.take() {
bytes_scanned.observe(self.bytes_scanned_counter as f64);
Expand Down Expand Up @@ -160,7 +160,7 @@ impl<'a, K, V> SafeRevIter<'a, K, V> {
}
}

impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for SafeRevIter<'a, K, V> {
impl<K: DeserializeOwned, V: DeserializeOwned> Iterator for SafeRevIter<'_, K, V> {
type Item = Result<(K, V), TypedStoreError>;

/// Will give the next item backwards
Expand Down
4 changes: 2 additions & 2 deletions crates/typed-store/src/rocks/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum TestIteratorWrapper<'a, K, V> {
// for different types of Iterator. For non-safe Iterator, it returns the key
// value pair. For SafeIterator, it consumes the result (assuming no error), and
// return they key value pairs.
impl<'a, K: DeserializeOwned, V: DeserializeOwned> Iterator for TestIteratorWrapper<'a, K, V> {
impl<K: DeserializeOwned, V: DeserializeOwned> Iterator for TestIteratorWrapper<'_, K, V> {
type Item = (K, V);
fn next(&mut self) -> Option<Self::Item> {
match self {
Expand Down Expand Up @@ -92,7 +92,7 @@ where
}
}

impl<'a, K: Serialize, V> TestIteratorWrapper<'a, K, V> {
impl<K: Serialize, V> TestIteratorWrapper<'_, K, V> {
pub fn skip_to(self, key: &K) -> Result<Self, TypedStoreError> {
match self {
TestIteratorWrapper::Iter(iter) => Ok(TestIteratorWrapper::Iter(iter.skip_to(key)?)),
Expand Down
Loading

0 comments on commit b45cbce

Please sign in to comment.