]> git.lizzy.rs Git - rust.git/commitdiff
DSTify free functions in std::hash
authorwe <vadim.petrochenkov@gmail.com>
Sat, 22 Nov 2014 14:03:40 +0000 (17:03 +0300)
committerwe <vadim.petrochenkov@gmail.com>
Sat, 22 Nov 2014 14:03:40 +0000 (17:03 +0300)
src/libcollections/hash/sip.rs

index 67ac73bf0b9f6b4b385d233e85ab31dee67e5497..ab69a3ad8b883c0dde0a744c16030c3a8e6592fb 100644 (file)
@@ -251,7 +251,7 @@ fn default() -> SipHasher {
 
 /// Hashes a value using the SipHash algorithm.
 #[inline]
-pub fn hash<T: Hash<SipState>>(value: &T) -> u64 {
+pub fn hash<Sized? T: Hash<SipState>>(value: &T) -> u64 {
     let mut state = SipState::new();
     value.hash(&mut state);
     state.result()
@@ -259,7 +259,7 @@ pub fn hash<T: Hash<SipState>>(value: &T) -> u64 {
 
 /// Hashes a value with the SipHash algorithm with the provided keys.
 #[inline]
-pub fn hash_with_keys<T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
+pub fn hash_with_keys<Sized? T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
     let mut state = SipState::new_with_keys(k0, k1);
     value.hash(&mut state);
     state.result()