@@ -74,7 +74,7 @@ pub unsafe fn new_array_buffer(
7474 buf : Vec < u8 > ,
7575) -> Result < QuickJsValueAdapter , JsError > {
7676 #[ cfg( target_pointer_width = "64" ) ]
77- let length = buf. len ( ) as u64 ;
77+ let length = buf. len ( ) ;
7878 #[ cfg( target_pointer_width = "32" ) ]
7979 let length = buf. len ( ) as u32 ;
8080
@@ -157,7 +157,7 @@ pub unsafe fn new_array_buffer_copy(
157157 buf : & [ u8 ] ,
158158) -> Result < QuickJsValueAdapter , JsError > {
159159 #[ cfg( target_pointer_width = "64" ) ]
160- let length = buf. len ( ) as u64 ;
160+ let length = buf. len ( ) ;
161161 #[ cfg( target_pointer_width = "32" ) ]
162162 let length = buf. len ( ) as u32 ;
163163
@@ -208,13 +208,13 @@ pub unsafe fn detach_array_buffer_buffer(
208208 } )
209209 } else {
210210 #[ cfg( target_pointer_width = "64" ) ]
211- let mut len: u64 = 0 ;
211+ let mut len: usize = 0 ;
212212 #[ cfg( target_pointer_width = "32" ) ]
213213 let mut len: u32 = 0 ;
214214
215215 let ptr = q:: JS_GetArrayBuffer ( ctx, & mut len, * array_buffer. borrow_value ( ) ) ;
216216
217- Vec :: from_raw_parts ( ptr, len as usize , len as usize )
217+ Vec :: from_raw_parts ( ptr, len as usize , len as _ )
218218 } ;
219219
220220 q:: JS_DetachArrayBuffer ( ctx, * array_buffer. borrow_value ( ) ) ;
@@ -244,13 +244,13 @@ pub unsafe fn get_array_buffer_buffer_copy(
244244 debug_assert ! ( is_array_buffer( ctx, array_buffer) ) ;
245245
246246 #[ cfg( target_pointer_width = "64" ) ]
247- let mut len: u64 = 0 ;
247+ let mut len: usize = 0 ;
248248 #[ cfg( target_pointer_width = "32" ) ]
249249 let mut len: u32 = 0 ;
250250
251251 let ptr = q:: JS_GetArrayBuffer ( ctx, & mut len, * array_buffer. borrow_value ( ) ) ;
252252
253- let slice = std:: slice:: from_raw_parts ( ptr, len as usize ) ;
253+ let slice = std:: slice:: from_raw_parts ( ptr, len as _ ) ;
254254
255255 Ok ( slice. to_vec ( ) )
256256}
0 commit comments