From f7721eab817f3d453c0ddca634beb9060ce119a0 Mon Sep 17 00:00:00 2001 From: Jeeyong Um Date: Fri, 23 Aug 2024 19:30:11 +0900 Subject: [PATCH] Update primitives/account/src/lib.rs Co-authored-by: Bear Wang --- primitives/account/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/primitives/account/src/lib.rs b/primitives/account/src/lib.rs index 2ba53f9251..955d82cd3f 100644 --- a/primitives/account/src/lib.rs +++ b/primitives/account/src/lib.rs @@ -48,7 +48,8 @@ impl core::str::FromStr for AccountId20 { type Err = &'static str; fn from_str(s: &str) -> Result { - <[u8; 20] as hex::FromHex>::from_hex(s.strip_prefix("0x").unwrap_or(s)) +#[cfg(feature = "std")] +impl std::str::FromStr for AccountId20 { .map(Into::into) .map_err(|_| "invalid hex address.") }