Skip to content

Commit 6e9d756

Browse files
committed
Fix lifetime warnings
1 parent 521169d commit 6e9d756

File tree

11 files changed

+13
-13
lines changed

11 files changed

+13
-13
lines changed

ledger/src/account/account.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,11 +1331,11 @@ impl Account {
13311331
}
13321332
}
13331333

1334-
pub fn delegate_or_empty(&self) -> MyCow<CompressedPubKey> {
1334+
pub fn delegate_or_empty(&self) -> MyCow<'_, CompressedPubKey> {
13351335
MyCow::borrow_or_else(&self.delegate, CompressedPubKey::empty)
13361336
}
13371337

1338-
pub fn zkapp_or_empty(&self) -> MyCow<Box<ZkAppAccount>> {
1338+
pub fn zkapp_or_empty(&self) -> MyCow<'_, Box<ZkAppAccount>> {
13391339
MyCow::borrow_or_else(&self.zkapp, Box::<ZkAppAccount>::default)
13401340
}
13411341

ledger/src/ondisk/compression.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl MaybeCompressed<'_> {
1919
}
2020

2121
#[cfg(feature = "compression")]
22-
pub fn compress(bytes: &[u8]) -> std::io::Result<MaybeCompressed> {
22+
pub fn compress(bytes: &[u8]) -> std::io::Result<MaybeCompressed<'_>> {
2323
let compressed = {
2424
let mut result = Vec::<u8>::with_capacity(bytes.len());
2525
zstd::stream::copy_encode(bytes, &mut result, zstd::DEFAULT_COMPRESSION_LEVEL)?;
@@ -34,7 +34,7 @@ pub fn compress(bytes: &[u8]) -> std::io::Result<MaybeCompressed> {
3434
}
3535

3636
#[cfg(not(feature = "compression"))]
37-
pub fn compress(bytes: &[u8]) -> std::io::Result<MaybeCompressed> {
37+
pub fn compress(bytes: &[u8]) -> std::io::Result<MaybeCompressed<'_>> {
3838
Ok(MaybeCompressed::No(bytes))
3939
}
4040

ledger/src/proofs/zkapp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ pub struct ZkappCommandWitnessesParams<'a> {
455455
}
456456

457457
pub fn zkapp_command_witnesses_exn(
458-
params: ZkappCommandWitnessesParams,
458+
params: ZkappCommandWitnessesParams<'_>,
459459
) -> Result<
460460
Vec<(
461461
ZkappCommandSegmentWitness<'_>,

ledger/src/scan_state/scan_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ pub mod transaction_snark {
709709
}
710710
}
711711

712-
pub fn iter(&self) -> OneOrTwoIter<T> {
712+
pub fn iter(&self) -> OneOrTwoIter<'_, T> {
713713
let array = match self {
714714
OneOrTwo::One(a) => [Some(a), None],
715715
OneOrTwo::Two((a, b)) => [Some(a), Some(b)],

ledger/src/scan_state/transaction_logic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ pub mod zkapp_command {
22942294
}
22952295

22962296
/// <https://github.com/MinaProtocol/mina/blob/3fe924c80a4d01f418b69f27398f5f93eb652514/src/lib/mina_base/account_update.ml#L635>
2297-
pub fn to_full(&self) -> MyCow<Account> {
2297+
pub fn to_full(&self) -> MyCow<'_, Account> {
22982298
MyCow::Borrow(&self.0)
22992299
}
23002300

ledger/src/zkapps/intefaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ where
459459
fn get(&self) -> &crate::Account;
460460
fn get_mut(&mut self) -> &mut crate::Account;
461461
fn set_delegate(&mut self, new: CompressedPubKey);
462-
fn zkapp(&self) -> MyCow<ZkAppAccount>;
462+
fn zkapp(&self) -> MyCow<'_, ZkAppAccount>;
463463
fn zkapp_mut(&mut self) -> &mut ZkAppAccount;
464464
fn verification_key_hash(&self) -> Self::VerificationKeyHash;
465465
fn set_token_id(&mut self, token_id: TokenId);

ledger/src/zkapps/non_snark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ impl AccountInterface for Account {
664664
};
665665
}
666666

667-
fn zkapp(&self) -> MyCow<ZkAppAccount> {
667+
fn zkapp(&self) -> MyCow<'_, ZkAppAccount> {
668668
match self.zkapp.as_ref() {
669669
Some(zkapp) => MyCow::Borrow(zkapp),
670670
None => MyCow::Own(ZkAppAccount::default()),

ledger/src/zkapps/snark.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ impl AccountInterface for SnarkAccount {
902902
Some(new)
903903
};
904904
}
905-
fn zkapp(&self) -> MyCow<ZkAppAccount> {
905+
fn zkapp(&self) -> MyCow<'_, ZkAppAccount> {
906906
match &self.zkapp {
907907
Some(zkapp) => MyCow::Borrow(zkapp),
908908
None => MyCow::Own(ZkAppAccount::default()),

node/src/recorder/replayer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl StateWithInputActionsReader {
2222
super::initial_state_path(&self.dir)
2323
}
2424

25-
pub fn read_initial_state(&self) -> Result<RecordedInitialState, Box<dyn Error>> {
25+
pub fn read_initial_state(&self) -> Result<RecordedInitialState<'_>, Box<dyn Error>> {
2626
let path = self.initial_state_path();
2727
let encoded = fs::read(path)?;
2828
Ok(RecordedInitialState::decode(&encoded)?)

node/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ impl P2p {
678678
.collect()
679679
}
680680

681-
pub fn ready_peers_iter(&self) -> ReadyPeersIter {
681+
pub fn ready_peers_iter(&self) -> ReadyPeersIter<'_> {
682682
ReadyPeersIter::new(self)
683683
}
684684
}

0 commit comments

Comments
 (0)