Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#1234](https://github.com/o1-labs/openmina/pull/1234))
- **Formatting**: Standardized markdown and MDX files to 80-character line
wrapping ([#1234](https://github.com/o1-labs/openmina/pull/1234))
- **Build warnings**: Fix the warnings generated by the missing lifetime
([#1244](https://github.com/o1-labs/openmina/pull/1244))

### Dependencies

Expand Down
4 changes: 2 additions & 2 deletions ledger/src/account/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1331,11 +1331,11 @@ impl Account {
}
}

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

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

Expand Down
4 changes: 2 additions & 2 deletions ledger/src/ondisk/compression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl MaybeCompressed<'_> {
}

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

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

Expand Down
2 changes: 1 addition & 1 deletion ledger/src/proofs/zkapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ pub struct ZkappCommandWitnessesParams<'a> {
}

pub fn zkapp_command_witnesses_exn(
params: ZkappCommandWitnessesParams,
params: ZkappCommandWitnessesParams<'_>,
) -> Result<
Vec<(
ZkappCommandSegmentWitness<'_>,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/scan_state/scan_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ pub mod transaction_snark {
}
}

pub fn iter(&self) -> OneOrTwoIter<T> {
pub fn iter(&self) -> OneOrTwoIter<'_, T> {
let array = match self {
OneOrTwo::One(a) => [Some(a), None],
OneOrTwo::Two((a, b)) => [Some(a), Some(b)],
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/scan_state/transaction_logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,7 @@ pub mod zkapp_command {
}

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

Expand Down
2 changes: 1 addition & 1 deletion ledger/src/zkapps/intefaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ where
fn get(&self) -> &crate::Account;
fn get_mut(&mut self) -> &mut crate::Account;
fn set_delegate(&mut self, new: CompressedPubKey);
fn zkapp(&self) -> MyCow<ZkAppAccount>;
fn zkapp(&self) -> MyCow<'_, ZkAppAccount>;
fn zkapp_mut(&mut self) -> &mut ZkAppAccount;
fn verification_key_hash(&self) -> Self::VerificationKeyHash;
fn set_token_id(&mut self, token_id: TokenId);
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/zkapps/non_snark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl AccountInterface for Account {
};
}

fn zkapp(&self) -> MyCow<ZkAppAccount> {
fn zkapp(&self) -> MyCow<'_, ZkAppAccount> {
match self.zkapp.as_ref() {
Some(zkapp) => MyCow::Borrow(zkapp),
None => MyCow::Own(ZkAppAccount::default()),
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/zkapps/snark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ impl AccountInterface for SnarkAccount {
Some(new)
};
}
fn zkapp(&self) -> MyCow<ZkAppAccount> {
fn zkapp(&self) -> MyCow<'_, ZkAppAccount> {
match &self.zkapp {
Some(zkapp) => MyCow::Borrow(zkapp),
None => MyCow::Own(ZkAppAccount::default()),
Expand Down
2 changes: 1 addition & 1 deletion node/src/recorder/replayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl StateWithInputActionsReader {
super::initial_state_path(&self.dir)
}

pub fn read_initial_state(&self) -> Result<RecordedInitialState, Box<dyn Error>> {
pub fn read_initial_state(&self) -> Result<RecordedInitialState<'_>, Box<dyn Error>> {
let path = self.initial_state_path();
let encoded = fs::read(path)?;
Ok(RecordedInitialState::decode(&encoded)?)
Expand Down
2 changes: 1 addition & 1 deletion node/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ impl P2p {
.collect()
}

pub fn ready_peers_iter(&self) -> ReadyPeersIter {
pub fn ready_peers_iter(&self) -> ReadyPeersIter<'_> {
ReadyPeersIter::new(self)
}
}
Expand Down
2 changes: 1 addition & 1 deletion node/testing/src/scenarios/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl<'cluster> Driver<'cluster> {
(node_id, item)
}

pub fn inner(&self) -> &ClusterRunner {
pub fn inner(&self) -> &ClusterRunner<'_> {
&self.runner
}

Expand Down