|
11 | 11 | //! connect the fact that they can only be produced by a `StableHasher` to their |
12 | 12 | //! `Encode`/`Decode` impls. |
13 | 13 |
|
14 | | -usecrate::stable_hasher::{StableHasher,StableHasherResult}; |
| 14 | +usecrate::stable_hasher::{FromStableHash,StableHasherHash}; |
15 | 15 | use rustc_serialize::{Decodable,Decoder,Encodable,Encoder}; |
16 | 16 | use std::fmt; |
17 | 17 | use std::ops::BitXorAssign; |
@@ -56,10 +56,12 @@ impl<D: Decoder> Decodable<D> for Hash64 { |
56 | 56 | } |
57 | 57 | } |
58 | 58 |
|
59 | | -implStableHasherResultforHash64{ |
| 59 | +implFromStableHashforHash64{ |
| 60 | +typeHash = StableHasherHash; |
| 61 | + |
60 | 62 | #[inline] |
61 | | -fnfinish(hasher:StableHasher) -> Self{ |
62 | | -Self{inner:hasher.finalize().0} |
| 63 | +fnfrom(StableHasherHash([_0, __1]):Self::Hash) -> Self{ |
| 64 | +Self{inner:_0} |
63 | 65 | } |
64 | 66 | } |
65 | 67 |
|
@@ -121,10 +123,11 @@ impl<D: Decoder> Decodable<D> for Hash128 { |
121 | 123 | } |
122 | 124 | } |
123 | 125 |
|
124 | | -implStableHasherResultforHash128{ |
| 126 | +implFromStableHashforHash128{ |
| 127 | +typeHash = StableHasherHash; |
| 128 | + |
125 | 129 | #[inline] |
126 | | -fnfinish(hasher:StableHasher) -> Self{ |
127 | | -let(_0, _1) = hasher.finalize(); |
| 130 | +fnfrom(StableHasherHash([_0, _1]):Self::Hash) -> Self{ |
128 | 131 | Self{inner: u128::from(_0) | (u128::from(_1) << 64)} |
129 | 132 | } |
130 | 133 | } |
|
0 commit comments