@@ -38,7 +38,7 @@ pub struct SipHasher13 {
38
38
#[ rustc_deprecated( since = "1.13.0" ,
39
39
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
40
40
#[ derive( Debug , Clone , Default ) ]
41
- pub struct SipHasher24 {
41
+ struct SipHasher24 {
42
42
hasher : Hasher < Sip24Rounds > ,
43
43
}
44
44
@@ -156,7 +156,9 @@ impl SipHasher {
156
156
#[ rustc_deprecated( since = "1.13.0" ,
157
157
reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
158
158
pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher {
159
- SipHasher ( SipHasher24 :: new_with_keys ( key0, key1) )
159
+ SipHasher ( SipHasher24 {
160
+ hasher : Hasher :: new_with_keys ( key0, key1)
161
+ } )
160
162
}
161
163
}
162
164
@@ -182,28 +184,6 @@ impl SipHasher13 {
182
184
}
183
185
}
184
186
185
- impl SipHasher24 {
186
- /// Creates a new `SipHasher24` with the two initial keys set to 0.
187
- #[ inline]
188
- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
189
- #[ rustc_deprecated( since = "1.13.0" ,
190
- reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
191
- pub fn new ( ) -> SipHasher24 {
192
- SipHasher24 :: new_with_keys ( 0 , 0 )
193
- }
194
-
195
- /// Creates a `SipHasher24` that is keyed off the provided keys.
196
- #[ inline]
197
- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
198
- #[ rustc_deprecated( since = "1.13.0" ,
199
- reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
200
- pub fn new_with_keys ( key0 : u64 , key1 : u64 ) -> SipHasher24 {
201
- SipHasher24 {
202
- hasher : Hasher :: new_with_keys ( key0, key1)
203
- }
204
- }
205
- }
206
-
207
187
impl < S : Sip > Hasher < S > {
208
188
#[ inline]
209
189
fn new_with_keys ( key0 : u64 , key1 : u64 ) -> Hasher < S > {
@@ -271,12 +251,12 @@ impl<S: Sip> Hasher<S> {
271
251
impl super :: Hasher for SipHasher {
272
252
#[ inline]
273
253
fn write ( & mut self , msg : & [ u8 ] ) {
274
- self . 0 . write ( msg)
254
+ self . 0 . hasher . write ( msg)
275
255
}
276
256
277
257
#[ inline]
278
258
fn finish ( & self ) -> u64 {
279
- self . 0 . finish ( )
259
+ self . 0 . hasher . finish ( )
280
260
}
281
261
}
282
262
@@ -293,19 +273,6 @@ impl super::Hasher for SipHasher13 {
293
273
}
294
274
}
295
275
296
- #[ unstable( feature = "sip_hash_13" , issue = "34767" ) ]
297
- impl super :: Hasher for SipHasher24 {
298
- #[ inline]
299
- fn write ( & mut self , msg : & [ u8 ] ) {
300
- self . hasher . write ( msg)
301
- }
302
-
303
- #[ inline]
304
- fn finish ( & self ) -> u64 {
305
- self . hasher . finish ( )
306
- }
307
- }
308
-
309
276
impl < S : Sip > super :: Hasher for Hasher < S > {
310
277
// see short_write comment for explanation
311
278
#[ inline]
0 commit comments