about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-27 15:23:01 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-27 15:36:46 +0200
commit4c14f9d110478edcb2d0c3e1cda73937fc3b3d6e (patch)
tree14de4b22e8e528f6eb1b37c874c6d3eab9cd0707
parent033013cab3a861224fd55f494c8be1cb0349eb49 (diff)
downloadrust-4c14f9d110478edcb2d0c3e1cda73937fc3b3d6e.tar.gz
rust-4c14f9d110478edcb2d0c3e1cda73937fc3b3d6e.zip
Forward Hash::write_iN to Hash::write_uN
-rw-r--r--src/libcore/hash/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs
index d80101753cb..6abe19dc155 100644
--- a/src/libcore/hash/mod.rs
+++ b/src/libcore/hash/mod.rs
@@ -333,31 +333,31 @@ pub trait Hasher {
     #[inline]
     #[stable(feature = "hasher_write", since = "1.3.0")]
     fn write_i16(&mut self, i: i16) {
-        self.write(&i.to_ne_bytes())
+        self.write_u16(i as u16)
     }
     /// Writes a single `i32` into this hasher.
     #[inline]
     #[stable(feature = "hasher_write", since = "1.3.0")]
     fn write_i32(&mut self, i: i32) {
-        self.write(&i.to_ne_bytes())
+        self.write_u32(i as u32)
     }
     /// Writes a single `i64` into this hasher.
     #[inline]
     #[stable(feature = "hasher_write", since = "1.3.0")]
     fn write_i64(&mut self, i: i64) {
-        self.write(&i.to_ne_bytes())
+        self.write_u64(i as u64)
     }
     /// Writes a single `i128` into this hasher.
     #[inline]
     #[stable(feature = "i128", since = "1.26.0")]
     fn write_i128(&mut self, i: i128) {
-        self.write(&i.to_ne_bytes())
+        self.write_u128(i as u128)
     }
     /// Writes a single `isize` into this hasher.
     #[inline]
     #[stable(feature = "hasher_write", since = "1.3.0")]
     fn write_isize(&mut self, i: isize) {
-        self.write(&i.to_ne_bytes())
+        self.write_usize(i as usize)
     }
 }