@@ -38,7 +38,7 @@ pub struct SipHasher13 {
3838#[ rustc_deprecated( since = "1.13.0" ,
3939 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
4040#[ derive( Debug , Clone , Default ) ]
41- pub struct SipHasher24 {
41+ struct SipHasher24 {
4242 hasher : Hasher < Sip24Rounds > ,
4343}
4444
@@ -156,7 +156,9 @@ impl SipHasher {
156156 #[ rustc_deprecated( since = "1.13.0" ,
157157 reason = "use `std::collections::hash_map::DefaultHasher` instead" ) ]
158158 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+ } )
160162 }
161163}
162164
@@ -182,28 +184,6 @@ impl SipHasher13 {
182184 }
183185}
184186
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-
207187impl < S : Sip > Hasher < S > {
208188 #[ inline]
209189 fn new_with_keys ( key0 : u64 , key1 : u64 ) -> Hasher < S > {
@@ -271,12 +251,12 @@ impl<S: Sip> Hasher<S> {
271251impl super :: Hasher for SipHasher {
272252 #[ inline]
273253 fn write ( & mut self , msg : & [ u8 ] ) {
274- self . 0 . write ( msg)
254+ self . 0 . hasher . write ( msg)
275255 }
276256
277257 #[ inline]
278258 fn finish ( & self ) -> u64 {
279- self . 0 . finish ( )
259+ self . 0 . hasher . finish ( )
280260 }
281261}
282262
@@ -293,19 +273,6 @@ impl super::Hasher for SipHasher13 {
293273 }
294274}
295275
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-
309276impl < S : Sip > super :: Hasher for Hasher < S > {
310277 // see short_write comment for explanation
311278 #[ inline]
0 commit comments