Skip to content

Commit 0155dee

Browse files
committed
rust: make format (separate commit to allow reviewing actual changes)
1 parent 2d2a71f commit 0155dee

File tree

13 files changed

+28
-37
lines changed

13 files changed

+28
-37
lines changed

ledger/src/account/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ pub enum AuthRequired {
257257
Both, // Legacy only
258258
}
259259

260-
261260
impl From<ControlTag> for AuthRequired {
262261
/// <https://github.com/MinaProtocol/mina/blob/3753a8593cc1577bcf4da16620daf9946d88e8e5/src/lib/mina_base/permissions.ml#L68>
263262
fn from(value: ControlTag) -> Self {

ledger/src/proofs/circuit_blobs.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,9 @@ pub fn fetch_blocking(filename: &impl AsRef<Path>) -> std::io::Result<Vec<u8>> {
137137
}
138138

139139
fn to_io_err(err: impl std::fmt::Display) -> std::io::Error {
140-
std::io::Error::other(
141-
format!(
142-
"failed to find circuit-blobs locally and to fetch the from github! error: {err}"
143-
),
144-
)
140+
std::io::Error::other(format!(
141+
"failed to find circuit-blobs locally and to fetch the from github! error: {err}"
142+
))
145143
}
146144

147145
let home_base_dir = home_base_dir();

ledger/src/scan_state/transaction_logic/local_state.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ use mina_curves::pasta::Fp;
3030
use poseidon::hash::{hash_with_kimchi, params::MINA_ACCOUNT_UPDATE_STACK_FRAME, Inputs};
3131
use std::{cell::RefCell, collections::BTreeMap, rc::Rc};
3232

33-
#[derive(Debug, Clone)]
34-
#[derive(Default)]
33+
#[derive(Debug, Clone, Default)]
3534
pub struct StackFrame {
3635
pub caller: TokenId,
3736
pub caller_caller: TokenId,
@@ -72,7 +71,6 @@ enum LazyValueInner<T, D> {
7271
None,
7372
}
7473

75-
7674
pub struct LazyValue<T, D> {
7775
value: Rc<RefCell<LazyValueInner<T, D>>>,
7876
}
@@ -185,7 +183,6 @@ impl<T> ToFieldElements<Fp> for WithLazyHash<T> {
185183
// <https://github.com/MinaProtocol/mina/blob/78535ae3a73e0e90c5f66155365a934a15535779/src/lib/transaction_snark/transaction_snark.ml#L1083>
186184
pub type StackFrameChecked = WithLazyHash<StackFrameCheckedFrame>;
187185

188-
189186
impl StackFrame {
190187
pub fn empty() -> Self {
191188
Self {

ledger/src/transaction_pool.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ impl VkRefcountTable {
385385
return Vec::new();
386386
};
387387

388-
vks.keys().map(|f| self.find_vk(f).expect("malformed Vk_refcount_table.t"))
388+
vks.keys()
389+
.map(|f| self.find_vk(f).expect("malformed Vk_refcount_table.t"))
389390
.map(|(_, vk)| vk)
390391
.collect()
391392
}

node/common/src/service/archive/rpc.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ fn process_rpc(address: SocketAddr, data: &[u8]) -> io::Result<HandleResult> {
100100
event_count += 1;
101101
// Failsafe to prevent infinite loops
102102
if event_count > super::MAX_EVENT_COUNT {
103-
return Err(io::Error::other(
104-
format!("FAILSAFE triggered, event count: {}", event_count),
105-
));
103+
return Err(io::Error::other(format!(
104+
"FAILSAFE triggered, event count: {}",
105+
event_count
106+
)));
106107
}
107108
match event.token() {
108109
TOKEN => {

node/src/ledger/write/ledger_write_state.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use serde::{Deserialize, Serialize};
22

33
use super::{LedgerWriteRequest, LedgerWriteResponse};
44

5-
#[derive(Serialize, Deserialize, Debug, Clone)]
6-
#[derive(Default)]
5+
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
76
pub enum LedgerWriteState {
87
#[default]
98
Idle,
@@ -46,4 +45,3 @@ impl LedgerWriteState {
4645
self.pending_requests().peekable().peek().is_some()
4746
}
4847
}
49-

node/src/recorder/recorder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ impl Recorder {
137137
}
138138
}
139139

140-
141140
impl Drop for Recorder {
142141
fn drop(&mut self) {
143142
match self {

node/src/rpc/rpc_state.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ pub enum RpcRequestStatus {
3131
},
3232
}
3333

34-
#[derive(Serialize, Deserialize, Debug, Clone)]
35-
#[derive(Default)]
34+
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
3635
pub enum RpcRequestExtraData {
3736
#[default]
3837
None,
@@ -96,4 +95,3 @@ impl RpcState {
9695
})
9796
}
9897
}
99-

p2p/src/channels/rpc/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ impl P2pRpcKind {
8484
}
8585
}
8686

87-
#[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, PartialEq, Clone)]
88-
#[derive(Default)]
87+
#[derive(BinProtWrite, BinProtRead, Serialize, Deserialize, Debug, PartialEq, Clone, Default)]
8988
pub enum P2pRpcRequest {
9089
#[default]
9190
BestTipWithProof,
@@ -113,7 +112,6 @@ impl P2pRpcRequest {
113112
}
114113
}
115114

116-
117115
fn addr_to_str(
118116
MerkleAddressBinableArgStableV1(mina_p2p_messages::number::Number(length), byte_string): &MerkleAddressBinableArgStableV1,
119117
) -> String {

p2p/src/network/kad/request/p2p_network_kad_request_reducer.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ impl P2pNetworkKadRequestState {
220220
.and_then(|bootstrap_state| bootstrap_state.request(&peer_id))
221221
.is_some();
222222

223-
let closest_peers = if bootstrap_request { state.latest_request_peers.clone() } else { Default::default() };
223+
let closest_peers = if bootstrap_request {
224+
state.latest_request_peers.clone()
225+
} else {
226+
Default::default()
227+
};
224228

225229
let dispatcher = state_context.into_dispatcher();
226230

0 commit comments

Comments
 (0)