diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 45ca668..47b7543 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -12,7 +12,6 @@ std = [ "fixed-hash/std", "hex/std", "serde", - "impl-serde", "impl-codec/std", "primitive-types/std", @@ -22,7 +21,7 @@ std = [ [dependencies] byteorder = { version = "1.3", default-features = false } fixed-hash = { version = "0.7", default-features = false } -hex = { version = "0.4", default-features = false } +hex = { version = "0.4", default-features = false, features = ["alloc"] } serde = { version = "1.0", features = ["derive"], optional = true } impl-serde = { version = "0.3", optional = true } diff --git a/primitives/src/bytes.rs b/primitives/src/bytes.rs index bf7bb84..d6a424b 100644 --- a/primitives/src/bytes.rs +++ b/primitives/src/bytes.rs @@ -134,7 +134,7 @@ impl<'de> serde::de::Visitor<'de> for BytesVisitor { { if v.len() >= 2 { Ok(Bytes( - hex::decode(&v[..]).map_err(|_| serde::de::Error::custom("invalid hex"))?, + hex::decode(v).map_err(|_| serde::de::Error::custom("invalid hex"))?, )) } else { Err(serde::de::Error::custom("invalid format")) diff --git a/serialization/src/impls.rs b/serialization/src/impls.rs index 33b2311..561b2d5 100644 --- a/serialization/src/impls.rs +++ b/serialization/src/impls.rs @@ -120,7 +120,7 @@ impl Deserializable for i32 { where T: io::Read, { - Ok(reader.read_i32::()?) + reader.read_i32::() } } @@ -130,7 +130,7 @@ impl Deserializable for i64 { where T: io::Read, { - Ok(reader.read_i64::()?) + reader.read_i64::() } } @@ -140,7 +140,7 @@ impl Deserializable for u8 { where T: io::Read, { - Ok(reader.read_u8()?) + reader.read_u8() } } @@ -150,7 +150,7 @@ impl Deserializable for u16 { where T: io::Read, { - Ok(reader.read_u16::()?) + reader.read_u16::() } } @@ -160,7 +160,7 @@ impl Deserializable for u32 { where T: io::Read, { - Ok(reader.read_u32::()?) + reader.read_u32::() } } @@ -170,7 +170,7 @@ impl Deserializable for u64 { where T: io::Read, { - Ok(reader.read_u64::()?) + reader.read_u64::() } }