@@ -11,7 +11,7 @@ use std::{
1111 slice, str,
1212} ;
1313
14- use oxc_data_structures:: { assert_unchecked, pointer_ext :: PointerExt } ;
14+ use oxc_data_structures:: assert_unchecked;
1515
1616use crate :: { Allocator , alloc:: Alloc } ;
1717
@@ -245,7 +245,7 @@ impl<'a> StringBuilder<'a> {
245245 #[ inline( always) ]
246246 pub fn len ( & self ) -> usize {
247247 // SAFETY: `end_ptr` is always equal to or after `start_ptr`
248- unsafe { self . end_ptr . offset_from_usize ( self . start_ptr ) }
248+ unsafe { self . end_ptr . offset_from_unsigned ( self . start_ptr ) }
249249 }
250250
251251 /// Returns `true` if string is empty.
@@ -258,7 +258,7 @@ impl<'a> StringBuilder<'a> {
258258 #[ inline( always) ]
259259 pub fn capacity ( & self ) -> usize {
260260 // SAFETY: `end_capacity_ptr` is always equal to or after `start_ptr`
261- unsafe { self . end_capacity_ptr . offset_from_usize ( self . start_ptr ) }
261+ unsafe { self . end_capacity_ptr . offset_from_unsigned ( self . start_ptr ) }
262262 }
263263
264264 /// Consume [`StringBuilder`] and produce a `&'a str` with lifetime of the arena.
@@ -437,7 +437,7 @@ impl<'a> StringBuilder<'a> {
437437 #[ inline( always) ]
438438 pub fn reserve ( & mut self , additional : usize ) {
439439 // SAFETY: `end_capacity` is always equal to or after `end`
440- let free_bytes = unsafe { self . end_capacity_ptr . offset_from_usize ( self . end_ptr ) } ;
440+ let free_bytes = unsafe { self . end_capacity_ptr . offset_from_unsigned ( self . end_ptr ) } ;
441441 if free_bytes < additional {
442442 // Insufficient capacity for `additional` bytes. Grow the allocation.
443443 // SAFETY: We just checked allocation is full to capacity.
0 commit comments