style: Migrate to stable-only rustfmt configuration

- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml
- Removed features: imports_granularity, wrap_comments, comment_width,
  reorder_impl_items, spaces_around_ranges, binop_separator,
  match_arm_blocks, trailing_semicolon, trailing_comma
- Format all 898 affected files with stable rustfmt
- Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
2025-12-22 17:12:58 +03:00
parent 3208f208c0
commit abc4c3989b
898 changed files with 8671 additions and 6432 deletions
+3 -3
View File
@@ -92,9 +92,9 @@ impl PartialEq for ActiveLeavesUpdate {
///
/// Instead, it means equality when `activated` and `deactivated` are considered as sets.
fn eq(&self, other: &Self) -> bool {
self.activated.as_ref().map(|a| a.hash) == other.activated.as_ref().map(|a| a.hash) &&
self.deactivated.len() == other.deactivated.len() &&
self.deactivated.iter().all(|a| other.deactivated.contains(a))
self.activated.as_ref().map(|a| a.hash) == other.activated.as_ref().map(|a| a.hash)
&& self.deactivated.len() == other.deactivated.len()
&& self.deactivated.iter().all(|a| other.deactivated.contains(a))
}
}
+63 -42
View File
@@ -1053,10 +1053,12 @@ impl TryFrom<ApprovalVotingParallelMessage> for ApprovalVotingMessage {
fn try_from(msg: ApprovalVotingParallelMessage) -> Result<Self, Self::Error> {
match msg {
ApprovalVotingParallelMessage::ApprovedAncestor(hash, number, tx) =>
Ok(ApprovalVotingMessage::ApprovedAncestor(hash, number, tx)),
ApprovalVotingParallelMessage::GetApprovalSignaturesForCandidate(candidate, tx) =>
Ok(ApprovalVotingMessage::GetApprovalSignaturesForCandidate(candidate, tx)),
ApprovalVotingParallelMessage::ApprovedAncestor(hash, number, tx) => {
Ok(ApprovalVotingMessage::ApprovedAncestor(hash, number, tx))
},
ApprovalVotingParallelMessage::GetApprovalSignaturesForCandidate(candidate, tx) => {
Ok(ApprovalVotingMessage::GetApprovalSignaturesForCandidate(candidate, tx))
},
_ => Err(()),
}
}
@@ -1067,18 +1069,24 @@ impl TryFrom<ApprovalVotingParallelMessage> for ApprovalDistributionMessage {
fn try_from(msg: ApprovalVotingParallelMessage) -> Result<Self, Self::Error> {
match msg {
ApprovalVotingParallelMessage::NewBlocks(blocks) =>
Ok(ApprovalDistributionMessage::NewBlocks(blocks)),
ApprovalVotingParallelMessage::DistributeAssignment(assignment, claimed_cores) =>
Ok(ApprovalDistributionMessage::DistributeAssignment(assignment, claimed_cores)),
ApprovalVotingParallelMessage::DistributeApproval(vote) =>
Ok(ApprovalDistributionMessage::DistributeApproval(vote)),
ApprovalVotingParallelMessage::NetworkBridgeUpdate(msg) =>
Ok(ApprovalDistributionMessage::NetworkBridgeUpdate(msg)),
ApprovalVotingParallelMessage::GetApprovalSignatures(candidate_indicies, tx) =>
Ok(ApprovalDistributionMessage::GetApprovalSignatures(candidate_indicies, tx)),
ApprovalVotingParallelMessage::ApprovalCheckingLagUpdate(lag) =>
Ok(ApprovalDistributionMessage::ApprovalCheckingLagUpdate(lag)),
ApprovalVotingParallelMessage::NewBlocks(blocks) => {
Ok(ApprovalDistributionMessage::NewBlocks(blocks))
},
ApprovalVotingParallelMessage::DistributeAssignment(assignment, claimed_cores) => {
Ok(ApprovalDistributionMessage::DistributeAssignment(assignment, claimed_cores))
},
ApprovalVotingParallelMessage::DistributeApproval(vote) => {
Ok(ApprovalDistributionMessage::DistributeApproval(vote))
},
ApprovalVotingParallelMessage::NetworkBridgeUpdate(msg) => {
Ok(ApprovalDistributionMessage::NetworkBridgeUpdate(msg))
},
ApprovalVotingParallelMessage::GetApprovalSignatures(candidate_indicies, tx) => {
Ok(ApprovalDistributionMessage::GetApprovalSignatures(candidate_indicies, tx))
},
ApprovalVotingParallelMessage::ApprovalCheckingLagUpdate(lag) => {
Ok(ApprovalDistributionMessage::ApprovalCheckingLagUpdate(lag))
},
_ => Err(()),
}
}
@@ -1087,18 +1095,24 @@ impl TryFrom<ApprovalVotingParallelMessage> for ApprovalDistributionMessage {
impl From<ApprovalDistributionMessage> for ApprovalVotingParallelMessage {
fn from(msg: ApprovalDistributionMessage) -> Self {
match msg {
ApprovalDistributionMessage::NewBlocks(blocks) =>
ApprovalVotingParallelMessage::NewBlocks(blocks),
ApprovalDistributionMessage::DistributeAssignment(cert, bitfield) =>
ApprovalVotingParallelMessage::DistributeAssignment(cert, bitfield),
ApprovalDistributionMessage::DistributeApproval(vote) =>
ApprovalVotingParallelMessage::DistributeApproval(vote),
ApprovalDistributionMessage::NetworkBridgeUpdate(msg) =>
ApprovalVotingParallelMessage::NetworkBridgeUpdate(msg),
ApprovalDistributionMessage::GetApprovalSignatures(candidate_indicies, tx) =>
ApprovalVotingParallelMessage::GetApprovalSignatures(candidate_indicies, tx),
ApprovalDistributionMessage::ApprovalCheckingLagUpdate(lag) =>
ApprovalVotingParallelMessage::ApprovalCheckingLagUpdate(lag),
ApprovalDistributionMessage::NewBlocks(blocks) => {
ApprovalVotingParallelMessage::NewBlocks(blocks)
},
ApprovalDistributionMessage::DistributeAssignment(cert, bitfield) => {
ApprovalVotingParallelMessage::DistributeAssignment(cert, bitfield)
},
ApprovalDistributionMessage::DistributeApproval(vote) => {
ApprovalVotingParallelMessage::DistributeApproval(vote)
},
ApprovalDistributionMessage::NetworkBridgeUpdate(msg) => {
ApprovalVotingParallelMessage::NetworkBridgeUpdate(msg)
},
ApprovalDistributionMessage::GetApprovalSignatures(candidate_indicies, tx) => {
ApprovalVotingParallelMessage::GetApprovalSignatures(candidate_indicies, tx)
},
ApprovalDistributionMessage::ApprovalCheckingLagUpdate(lag) => {
ApprovalVotingParallelMessage::ApprovalCheckingLagUpdate(lag)
},
}
}
}
@@ -1296,28 +1310,33 @@ impl HypotheticalCandidate {
/// Get parent head data hash of the hypothetical candidate.
pub fn parent_head_data_hash(&self) -> Hash {
match *self {
HypotheticalCandidate::Complete { ref persisted_validation_data, .. } =>
persisted_validation_data.parent_head.hash(),
HypotheticalCandidate::Incomplete { parent_head_data_hash, .. } =>
parent_head_data_hash,
HypotheticalCandidate::Complete { ref persisted_validation_data, .. } => {
persisted_validation_data.parent_head.hash()
},
HypotheticalCandidate::Incomplete { parent_head_data_hash, .. } => {
parent_head_data_hash
},
}
}
/// Get candidate's relay parent.
pub fn relay_parent(&self) -> Hash {
match *self {
HypotheticalCandidate::Complete { ref receipt, .. } =>
receipt.descriptor.relay_parent(),
HypotheticalCandidate::Incomplete { candidate_relay_parent, .. } =>
candidate_relay_parent,
HypotheticalCandidate::Complete { ref receipt, .. } => {
receipt.descriptor.relay_parent()
},
HypotheticalCandidate::Incomplete { candidate_relay_parent, .. } => {
candidate_relay_parent
},
}
}
/// Get the output head data hash, if the candidate is complete.
pub fn output_head_data_hash(&self) -> Option<Hash> {
match *self {
HypotheticalCandidate::Complete { ref receipt, .. } =>
Some(receipt.descriptor.para_head()),
HypotheticalCandidate::Complete { ref receipt, .. } => {
Some(receipt.descriptor.para_head())
},
HypotheticalCandidate::Incomplete { .. } => None,
}
}
@@ -1333,8 +1352,9 @@ impl HypotheticalCandidate {
/// Get the persisted validation data, if the candidate is complete.
pub fn persisted_validation_data(&self) -> Option<&PersistedValidationData> {
match *self {
HypotheticalCandidate::Complete { ref persisted_validation_data, .. } =>
Some(persisted_validation_data),
HypotheticalCandidate::Complete { ref persisted_validation_data, .. } => {
Some(persisted_validation_data)
},
HypotheticalCandidate::Incomplete { .. } => None,
}
}
@@ -1342,8 +1362,9 @@ impl HypotheticalCandidate {
/// Get the validation code hash, if the candidate is complete.
pub fn validation_code_hash(&self) -> Option<ValidationCodeHash> {
match *self {
HypotheticalCandidate::Complete { ref receipt, .. } =>
Some(receipt.descriptor.validation_code_hash()),
HypotheticalCandidate::Complete { ref receipt, .. } => {
Some(receipt.descriptor.validation_code_hash())
},
HypotheticalCandidate::Incomplete { .. } => None,
}
}
@@ -89,24 +89,30 @@ impl<M> NetworkBridgeEvent<M> {
T: TryFrom<&'a M, Error = WrongVariant>,
{
Ok(match *self {
NetworkBridgeEvent::PeerMessage(ref peer, ref msg) =>
NetworkBridgeEvent::PeerMessage(*peer, T::try_from(msg)?),
NetworkBridgeEvent::PeerMessage(ref peer, ref msg) => {
NetworkBridgeEvent::PeerMessage(*peer, T::try_from(msg)?)
},
NetworkBridgeEvent::PeerConnected(
ref peer,
ref role,
ref version,
ref authority_id,
) => NetworkBridgeEvent::PeerConnected(*peer, *role, *version, authority_id.clone()),
NetworkBridgeEvent::PeerDisconnected(ref peer) =>
NetworkBridgeEvent::PeerDisconnected(*peer),
NetworkBridgeEvent::NewGossipTopology(ref topology) =>
NetworkBridgeEvent::NewGossipTopology(topology.clone()),
NetworkBridgeEvent::PeerViewChange(ref peer, ref view) =>
NetworkBridgeEvent::PeerViewChange(*peer, view.clone()),
NetworkBridgeEvent::OurViewChange(ref view) =>
NetworkBridgeEvent::OurViewChange(view.clone()),
NetworkBridgeEvent::UpdatedAuthorityIds(ref peer, ref authority_ids) =>
NetworkBridgeEvent::UpdatedAuthorityIds(*peer, authority_ids.clone()),
NetworkBridgeEvent::PeerDisconnected(ref peer) => {
NetworkBridgeEvent::PeerDisconnected(*peer)
},
NetworkBridgeEvent::NewGossipTopology(ref topology) => {
NetworkBridgeEvent::NewGossipTopology(topology.clone())
},
NetworkBridgeEvent::PeerViewChange(ref peer, ref view) => {
NetworkBridgeEvent::PeerViewChange(*peer, view.clone())
},
NetworkBridgeEvent::OurViewChange(ref view) => {
NetworkBridgeEvent::OurViewChange(view.clone())
},
NetworkBridgeEvent::UpdatedAuthorityIds(ref peer, ref authority_ids) => {
NetworkBridgeEvent::UpdatedAuthorityIds(*peer, authority_ids.clone())
},
})
}
}