udpated serde to version 0.7.0
This commit is contained in:
@@ -18,7 +18,7 @@ time = "0.1.34"
|
||||
tiny-keccak = "1.0"
|
||||
rocksdb = { git = "https://github.com/arkpar/rust-rocksdb.git" }
|
||||
lazy_static = "0.1"
|
||||
eth-secp256k1 = { git = "https://github.com/arkpar/rust-secp256k1.git" }
|
||||
eth-secp256k1 = { git = "https://github.com/ethcore/rust-secp256k1" }
|
||||
rust-crypto = "0.2.34"
|
||||
elastic-array = "0.4"
|
||||
heapsize = "0.3"
|
||||
@@ -26,7 +26,7 @@ itertools = "0.4"
|
||||
crossbeam = "0.2"
|
||||
slab = "0.1"
|
||||
sha3 = { path = "sha3" }
|
||||
serde = "0.6.7"
|
||||
serde = "0.7.0"
|
||||
clippy = { version = "0.0.44", optional = true }
|
||||
json-tests = { path = "json-tests" }
|
||||
rustc_version = "0.1.0"
|
||||
|
||||
@@ -239,7 +239,7 @@ macro_rules! impl_hash {
|
||||
where S: serde::Serializer {
|
||||
let mut hex = "0x".to_owned();
|
||||
hex.push_str(self.to_hex().as_ref());
|
||||
serializer.visit_str(hex.as_ref())
|
||||
serializer.serialize_str(hex.as_ref())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,10 +254,10 @@ macro_rules! impl_hash {
|
||||
fn visit_str<E>(&mut self, value: &str) -> Result<Self::Value, E> where E: serde::Error {
|
||||
// 0x + len
|
||||
if value.len() != 2 + $size * 2 {
|
||||
return Err(serde::Error::syntax("Invalid length."));
|
||||
return Err(serde::Error::custom("Invalid length."));
|
||||
}
|
||||
|
||||
value[2..].from_hex().map(|ref v| $from::from_slice(v)).map_err(|_| serde::Error::syntax("Invalid valid hex."))
|
||||
value[2..].from_hex().map(|ref v| $from::from_slice(v)).map_err(|_| serde::Error::custom("Invalid valid hex."))
|
||||
}
|
||||
|
||||
fn visit_string<E>(&mut self, value: String) -> Result<Self::Value, E> where E: serde::Error {
|
||||
@@ -265,7 +265,7 @@ macro_rules! impl_hash {
|
||||
}
|
||||
}
|
||||
|
||||
deserializer.visit(HashVisitor)
|
||||
deserializer.deserialize(HashVisitor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -760,7 +760,7 @@ macro_rules! construct_uint {
|
||||
self.to_bytes(&mut bytes);
|
||||
let len = cmp::max((self.bits() + 7) / 8, 1);
|
||||
hex.push_str(bytes[bytes.len() - len..].to_hex().as_ref());
|
||||
serializer.visit_str(hex.as_ref())
|
||||
serializer.serialize_str(hex.as_ref())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user