Skip to content

Commit 63a5212

Browse files
committed
fix: resolve result_large_err by boxing large error variants
Box XRPLWebSocketException inside XRPLClientException and box ServerInfo/ServerState variants in XRPLResult to bring enum sizes below the 128-byte clippy threshold. This resolves all 40 clippy::result_large_err warnings, bringing the codebase to zero clippy warnings under -D warnings.
1 parent 25716c8 commit 63a5212

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/asynch/clients/exceptions.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum XRPLClientException {
2323
XRPLFaucetError(#[from] XRPLFaucetException),
2424
#[cfg(feature = "websocket")]
2525
#[error("XRPL WebSocket error: {0}")]
26-
XRPLWebSocketError(#[from] XRPLWebSocketException),
26+
XRPLWebSocketError(Box<XRPLWebSocketException>),
2727
#[cfg(feature = "json-rpc")]
2828
#[error("XRPL JSON-RPC error: {0}")]
2929
XRPLJsonRpcError(#[from] XRPLJsonRpcException),
@@ -47,10 +47,17 @@ impl From<reqwless::Error> for XRPLClientException {
4747
}
4848
}
4949

50+
#[cfg(feature = "websocket")]
51+
impl From<XRPLWebSocketException> for XRPLClientException {
52+
fn from(error: XRPLWebSocketException) -> Self {
53+
XRPLClientException::XRPLWebSocketError(Box::new(error))
54+
}
55+
}
56+
5057
#[cfg(all(feature = "std", feature = "websocket"))]
5158
impl From<tokio_tungstenite::tungstenite::Error> for XRPLClientException {
5259
fn from(error: tokio_tungstenite::tungstenite::Error) -> Self {
53-
XRPLClientException::XRPLWebSocketError(XRPLWebSocketException::from(error))
60+
XRPLClientException::XRPLWebSocketError(Box::new(XRPLWebSocketException::from(error)))
5461
}
5562
}
5663

src/models/transactions/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ where
269269
{
270270
pub fn is_signed(&self) -> bool {
271271
if let Some(signers) = &self.signers {
272-
signers
273-
.iter()
274-
.all(|signer| !signer.txn_signature.is_empty() && !signer.signing_pub_key.is_empty())
272+
signers.iter().all(|signer| {
273+
!signer.txn_signature.is_empty() && !signer.signing_pub_key.is_empty()
274+
})
275275
} else {
276276
self.txn_signature.is_some() && self.signing_pub_key.is_some()
277277
}

0 commit comments

Comments
 (0)