@@ -100,7 +100,9 @@ pub trait Hash {
100
100
101
101
/// Feeds a slice of this type into the state provided.
102
102
#[ stable( feature = "hash_slice" , since = "1.3.0" ) ]
103
- fn hash_slice < H : Hasher > ( data : & [ Self ] , state : & mut H ) where Self : Sized {
103
+ fn hash_slice < H : Hasher > ( data : & [ Self ] , state : & mut H )
104
+ where Self : Sized
105
+ {
104
106
for piece in data {
105
107
piece. hash ( state) ;
106
108
}
@@ -121,7 +123,9 @@ pub trait Hasher {
121
123
/// Write a single `u8` into this hasher
122
124
#[ inline]
123
125
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
124
- fn write_u8 ( & mut self , i : u8 ) { self . write ( & [ i] ) }
126
+ fn write_u8 ( & mut self , i : u8 ) {
127
+ self . write ( & [ i] )
128
+ }
125
129
/// Write a single `u16` into this hasher.
126
130
#[ inline]
127
131
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
@@ -145,32 +149,41 @@ pub trait Hasher {
145
149
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
146
150
fn write_usize ( & mut self , i : usize ) {
147
151
let bytes = unsafe {
148
- :: slice:: from_raw_parts ( & i as * const usize as * const u8 ,
149
- mem:: size_of :: < usize > ( ) )
152
+ :: slice:: from_raw_parts ( & i as * const usize as * const u8 , mem:: size_of :: < usize > ( ) )
150
153
} ;
151
154
self . write ( bytes) ;
152
155
}
153
156
154
157
/// Write a single `i8` into this hasher.
155
158
#[ inline]
156
159
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
157
- fn write_i8 ( & mut self , i : i8 ) { self . write_u8 ( i as u8 ) }
160
+ fn write_i8 ( & mut self , i : i8 ) {
161
+ self . write_u8 ( i as u8 )
162
+ }
158
163
/// Write a single `i16` into this hasher.
159
164
#[ inline]
160
165
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
161
- fn write_i16 ( & mut self , i : i16 ) { self . write_u16 ( i as u16 ) }
166
+ fn write_i16 ( & mut self , i : i16 ) {
167
+ self . write_u16 ( i as u16 )
168
+ }
162
169
/// Write a single `i32` into this hasher.
163
170
#[ inline]
164
171
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
165
- fn write_i32 ( & mut self , i : i32 ) { self . write_u32 ( i as u32 ) }
172
+ fn write_i32 ( & mut self , i : i32 ) {
173
+ self . write_u32 ( i as u32 )
174
+ }
166
175
/// Write a single `i64` into this hasher.
167
176
#[ inline]
168
177
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
169
- fn write_i64 ( & mut self , i : i64 ) { self . write_u64 ( i as u64 ) }
178
+ fn write_i64 ( & mut self , i : i64 ) {
179
+ self . write_u64 ( i as u64 )
180
+ }
170
181
/// Write a single `isize` into this hasher.
171
182
#[ inline]
172
183
#[ stable( feature = "hasher_write" , since = "1.3.0" ) ]
173
- fn write_isize ( & mut self , i : isize ) { self . write_usize ( i as usize ) }
184
+ fn write_isize ( & mut self , i : isize ) {
185
+ self . write_usize ( i as usize )
186
+ }
174
187
}
175
188
176
189
//////////////////////////////////////////////////////////////////////////////
0 commit comments