Skip to content

Commit 6738611

Browse files
committed
chore: Use hex_conservative crate
Use the hex crate that is already bundled with rust-bitcoin instead of the `hex` crate that hasn't been updated in 4 years.
1 parent 672cbf1 commit 6738611

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

macro/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ proc-macro = true
1313
bitcoin = "0.32.5"
1414
quote = "1.0.23"
1515
proc-macro-error = "1.0.4"
16-
hex = "0.4.3"
1716
proc-macro2 = "1.0.51"

macro/src/parse.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use bitcoin::hex::FromHex;
12
use bitcoin::{
23
blockdata::opcodes::Opcode,
34
opcodes::{all::*, OP_0, OP_FALSE, OP_NOP2, OP_NOP3, OP_TRUE},
@@ -541,7 +542,7 @@ fn parse_data(token: TokenTree) -> (Syntax, Span) {
541542

542543
fn parse_bytes(token: TokenTree) -> (Syntax, Span) {
543544
let hex_bytes = &token.to_string()[2..];
544-
let bytes = hex::decode(hex_bytes).unwrap_or_else(|err| {
545+
let bytes = Vec::<u8>::from_hex(hex_bytes).unwrap_or_else(|err| {
545546
emit_error!(token.span(), "invalid hex literal ({})", err);
546547
});
547548
(Syntax::Bytes(bytes), token.span())

0 commit comments

Comments
 (0)