Revert b983e42936
.
This commit is contained in:
parent
15f5622a53
commit
7f51a1b976
23 changed files with 140 additions and 123 deletions
|
@ -1,5 +1,5 @@
|
|||
use crate::stable_hasher;
|
||||
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
|
||||
use rustc_serialize::{Decodable, Encodable};
|
||||
use std::convert::TryInto;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
|
@ -142,14 +142,14 @@ impl stable_hasher::StableHasherResult for Fingerprint {
|
|||
|
||||
impl_stable_hash_via_hash!(Fingerprint);
|
||||
|
||||
impl<E: Encoder> Encodable<E> for Fingerprint {
|
||||
impl<E: rustc_serialize::Encoder> Encodable<E> for Fingerprint {
|
||||
#[inline]
|
||||
fn encode(&self, s: &mut E) {
|
||||
s.emit_raw_bytes(&self.to_le_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
impl<D: Decoder> Decodable<D> for Fingerprint {
|
||||
impl<D: rustc_serialize::Decoder> Decodable<D> for Fingerprint {
|
||||
#[inline]
|
||||
fn decode(d: &mut D) -> Self {
|
||||
Fingerprint::from_le_bytes(d.read_raw_bytes(16).try_into().unwrap())
|
||||
|
@ -184,7 +184,7 @@ impl std::fmt::Display for PackedFingerprint {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: Encoder> Encodable<E> for PackedFingerprint {
|
||||
impl<E: rustc_serialize::Encoder> Encodable<E> for PackedFingerprint {
|
||||
#[inline]
|
||||
fn encode(&self, s: &mut E) {
|
||||
// Copy to avoid taking reference to packed field.
|
||||
|
@ -193,7 +193,7 @@ impl<E: Encoder> Encodable<E> for PackedFingerprint {
|
|||
}
|
||||
}
|
||||
|
||||
impl<D: Decoder> Decodable<D> for PackedFingerprint {
|
||||
impl<D: rustc_serialize::Decoder> Decodable<D> for PackedFingerprint {
|
||||
#[inline]
|
||||
fn decode(d: &mut D) -> Self {
|
||||
Self(Fingerprint::decode(d))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue