@@ -333,31 +333,31 @@ pub trait Hasher {
333
333
#[ inline]
334
334
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
335
335
fn write_i16 ( & mut self , i : i16 ) {
336
- self . write ( & i . to_ne_bytes ( ) )
336
+ self . write_u16 ( i as u16 )
337
337
}
338
338
/// Writes a single `i32` into this hasher.
339
339
#[ inline]
340
340
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
341
341
fn write_i32 ( & mut self , i : i32 ) {
342
- self . write ( & i . to_ne_bytes ( ) )
342
+ self . write_u32 ( i as u32 )
343
343
}
344
344
/// Writes a single `i64` into this hasher.
345
345
#[ inline]
346
346
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
347
347
fn write_i64 ( & mut self , i : i64 ) {
348
- self . write ( & i . to_ne_bytes ( ) )
348
+ self . write_u64 ( i as u64 )
349
349
}
350
350
/// Writes a single `i128` into this hasher.
351
351
#[ inline]
352
352
#[ stable( feature = "i128" , since = "1.26.0" ) ]
353
353
fn write_i128 ( & mut self , i : i128 ) {
354
- self . write ( & i . to_ne_bytes ( ) )
354
+ self . write_u128 ( i as u128 )
355
355
}
356
356
/// Writes a single `isize` into this hasher.
357
357
#[ inline]
358
358
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
359
359
fn write_isize ( & mut self , i : isize ) {
360
- self . write ( & i . to_ne_bytes ( ) )
360
+ self . write_usize ( i as usize )
361
361
}
362
362
}
363
363
0 commit comments