]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_data_structures/svh.rs
Rollup merge of #69554 - GuillaumeGomez:cleanup-e0374, r=Dylan-DPC
[rust.git] / src / librustc_data_structures / svh.rs
index 3123c182b0f4cb8058511d7ad54870be2a997224..476eb9e14f98f34313346ba153f82ac620683a97 100644 (file)
@@ -5,9 +5,9 @@
 //! 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;
 
@@ -34,7 +34,10 @@ pub fn to_string(&self) -> String {
 }
 
 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);
     }
 }
@@ -53,22 +56,14 @@ fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
 
 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<W: stable_hasher::StableHasherResult>(
-        &self,
-        ctx: &mut T,
-        hasher: &mut stable_hasher::StableHasher<W>
-    ) {
-        let Svh {
-            hash
-        } = *self;
+    fn hash_stable(&self, ctx: &mut T, hasher: &mut stable_hasher::StableHasher) {
+        let Svh { hash } = *self;
         hash.hash_stable(ctx, hasher);
     }
 }