Skip to content

Commit fb244d2

Browse files
committed
final ci fixes
1 parent 909041f commit fb244d2

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

lightning-block-sync/src/convert.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ impl From<HttpClientError> for BlockSourceError {
5454
}
5555
},
5656
// Parse errors are persistent (invalid data)
57-
HttpClientError::Parse(msg) => BlockSourceError::persistent(HttpClientError::Parse(msg)),
57+
HttpClientError::Parse(msg) => {
58+
BlockSourceError::persistent(HttpClientError::Parse(msg))
59+
},
5860
}
5961
}
6062
}
@@ -81,12 +83,14 @@ impl From<RpcClientError> for BlockSourceError {
8183
)))
8284
}
8385
},
84-
HttpClientError::Parse(msg) => BlockSourceError::persistent(RpcClientError::Http(
85-
HttpClientError::Parse(msg),
86-
)),
86+
HttpClientError::Parse(msg) => {
87+
BlockSourceError::persistent(RpcClientError::Http(HttpClientError::Parse(msg)))
88+
},
8789
},
8890
// RPC errors (e.g. "block not found") are transient
89-
RpcClientError::Rpc(rpc_err) => BlockSourceError::transient(RpcClientError::Rpc(rpc_err)),
91+
RpcClientError::Rpc(rpc_err) => {
92+
BlockSourceError::transient(RpcClientError::Rpc(rpc_err))
93+
},
9094
// Malformed response data is persistent
9195
RpcClientError::InvalidData(msg) => {
9296
BlockSourceError::persistent(RpcClientError::InvalidData(msg))
@@ -224,10 +228,7 @@ impl TryInto<(BlockHash, Option<u32>)> for JsonResponse {
224228
impl TryInto<Txid> for JsonResponse {
225229
type Error = String;
226230
fn try_into(self) -> Result<Txid, String> {
227-
let hex_data = self
228-
.0
229-
.as_str()
230-
.ok_or_else(|| "expected JSON string".to_string())?;
231+
let hex_data = self.0.as_str().ok_or_else(|| "expected JSON string".to_string())?;
231232
Txid::from_str(hex_data).map_err(|err| err.to_string())
232233
}
233234
}

lightning-block-sync/src/http.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,7 @@ impl TryFrom<Vec<u8>> for JsonResponse {
216216
type Error = String;
217217

218218
fn try_from(bytes: Vec<u8>) -> Result<Self, String> {
219-
serde_json::from_slice(&bytes)
220-
.map(JsonResponse)
221-
.map_err(|e| e.to_string())
219+
serde_json::from_slice(&bytes).map(JsonResponse).map_err(|e| e.to_string())
222220
}
223221
}
224222

0 commit comments

Comments
 (0)