diff --git a/rlp/Cargo.toml b/rlp/Cargo.toml index 0f1583e5..c7025104 100644 --- a/rlp/Cargo.toml +++ b/rlp/Cargo.toml @@ -6,11 +6,11 @@ repository = "https://github.com/paritytech/parity-common" license = "MIT OR Apache-2.0" authors = ["Parity Technologies "] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.64.0" [dependencies] bytes = { version = "1", default-features = false } -rustc-hex = { version = "2.0.1", default-features = false } +const-hex = { version = "1.13", default-features = false, features = ["alloc"] } rlp-derive = { version = "0.2", path = "../rlp-derive", optional = true } [dev-dependencies] @@ -20,7 +20,7 @@ primitive-types = { path = "../primitive-types", version = "0.13", features = [" [features] default = ["std"] -std = ["bytes/std", "rustc-hex/std"] +std = ["bytes/std", "const-hex/std"] derive = ["rlp-derive"] [[bench]] diff --git a/rlp/src/rlpin.rs b/rlp/src/rlpin.rs index 395808fa..538670bf 100644 --- a/rlp/src/rlpin.rs +++ b/rlp/src/rlpin.rs @@ -7,11 +7,9 @@ // except according to those terms. #[cfg(not(feature = "std"))] -use alloc::{string::String, vec::Vec}; +use alloc::vec::Vec; use core::{cell::Cell, fmt}; -use rustc_hex::ToHex; - use crate::{error::DecoderError, impls::decode_usize, traits::Decodable}; /// rlp offset @@ -110,7 +108,7 @@ impl<'a> fmt::Display for Rlp<'a> { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match self.prototype() { Ok(Prototype::Null) => write!(f, "null"), - Ok(Prototype::Data(_)) => write!(f, "\"0x{}\"", self.data().unwrap().to_hex::()), + Ok(Prototype::Data(_)) => write!(f, "\"{}\"", const_hex::encode_prefixed(self.data().unwrap())), Ok(Prototype::List(len)) => { write!(f, "[")?; for i in 0..len - 1 {