Skip to content

Commit e2b5067

Browse files
committed
rust: use .into not .try_into for hash->array conversion
Same as 0d40913.
1 parent 6620ee3 commit e2b5067

File tree

1 file changed

+1
-4
lines changed
  • src/rust/bitbox02-rust/src/hww/api/bitcoin

1 file changed

+1
-4
lines changed

src/rust/bitbox02-rust/src/hww/api/bitcoin/signmsg.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ pub async fn process(request: &pb::BtcSignMessageRequest) -> Result<Response, Er
8888
msg.extend(super::script::serialize_varint(request.msg.len() as _));
8989
msg.extend(&request.msg);
9090

91-
let sighash: [u8; 32] = Sha256::digest(Sha256::digest(msg))
92-
.as_slice()
93-
.try_into()
94-
.unwrap();
91+
let sighash: [u8; 32] = Sha256::digest(Sha256::digest(msg)).into();
9592

9693
let host_nonce = match request.host_nonce_commitment {
9794
// Engage in the anti-klepto protocol if the host sends a host nonce commitment.

0 commit comments

Comments
 (0)