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.") }