//! mismatches where we have two versions of the same crate that were
//! compiled from distinct sources.
+use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::fmt;
use std::hash::{Hash, Hasher};
-use rustc_serialize::{Encodable, Decodable, Encoder, Decoder};
use crate::stable_hasher;
}
impl Hash for Svh {
- fn hash<H>(&self, state: &mut H) where H: Hasher {
+ fn hash<H>(&self, state: &mut H)
+ where
+ H: Hasher,
+ {
self.hash.to_le().hash(state);
}
}
impl Decodable for Svh {
fn decode<D: Decoder>(d: &mut D) -> Result<Svh, D::Error> {
- d.read_u64()
- .map(u64::from_le)
- .map(Svh::new)
+ d.read_u64().map(u64::from_le).map(Svh::new)
}
}
impl<T> stable_hasher::HashStable<T> for Svh {
#[inline]
fn hash_stable(&self, ctx: &mut T, hasher: &mut stable_hasher::StableHasher) {
- let Svh {
- hash
- } = *self;
+ let Svh { hash } = *self;
hash.hash_stable(ctx, hasher);
}
}