Skip to content

Commit ed4f7a1

Browse files
authored
Make HexDisplay useable in no_std (paritytech#6883)
Actually I use this quite often when debugging some WASM bugs and there is no harm in enabling it by default. Before I just always copied it everytime I needed it.
1 parent 473a23f commit ed4f7a1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

primitives/core/src/hexdisplay.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl AsBytesRef for [u8] {
6767
fn as_bytes_ref(&self) -> &[u8] { &self }
6868
}
6969

70-
impl AsBytesRef for Vec<u8> {
70+
impl AsBytesRef for sp_std::vec::Vec<u8> {
7171
fn as_bytes_ref(&self) -> &[u8] { &self }
7272
}
7373

@@ -84,6 +84,7 @@ impl_non_endians!([u8; 1], [u8; 2], [u8; 3], [u8; 4], [u8; 5], [u8; 6], [u8; 7],
8484
[u8; 48], [u8; 56], [u8; 64], [u8; 65], [u8; 80], [u8; 96], [u8; 112], [u8; 128]);
8585

8686
/// Format into ASCII + # + hex, suitable for storage key preimages.
87+
#[cfg(feature = "std")]
8788
pub fn ascii_format(asciish: &[u8]) -> String {
8889
let mut r = String::new();
8990
let mut latch = false;

primitives/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ pub use impl_serde::serialize as bytes;
5252
pub mod hashing;
5353
#[cfg(feature = "full_crypto")]
5454
pub use hashing::{blake2_128, blake2_256, twox_64, twox_128, twox_256, keccak_256};
55-
#[cfg(feature = "std")]
5655
pub mod hexdisplay;
5756
pub mod crypto;
5857

0 commit comments

Comments
 (0)