Skip to content

Commit ea9b5d1

Browse files
committed
refactor(blocking): propagate hex-conservative errors instead of
`.unwrap()`.
1 parent c2c5485 commit ea9b5d1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/blocking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl BlockingClient {
144144
}
145145
Ok(resp) => {
146146
let hex_str = resp.as_str().map_err(Error::Minreq)?;
147-
let hex_vec = Vec::from_hex(hex_str).unwrap();
147+
let hex_vec = Vec::from_hex(hex_str)?;
148148
deserialize::<T>(&hex_vec)
149149
.map_err(Error::BitcoinEncoding)
150150
.map(|r| Some(r))
@@ -162,7 +162,7 @@ impl BlockingClient {
162162
}
163163
Ok(resp) => {
164164
let hex_str = resp.as_str().map_err(Error::Minreq)?;
165-
let hex_vec = Vec::from_hex(hex_str).unwrap();
165+
let hex_vec = Vec::from_hex(hex_str)?;
166166
deserialize::<T>(&hex_vec).map_err(Error::BitcoinEncoding)
167167
}
168168
Err(e) => Err(e),

0 commit comments

Comments
 (0)