File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ pub mod arc {
9696 sequestered : self . sequestered . clone ( ) ,
9797 } ;
9898
99- unsafe { self . ptr = self . ptr . add ( index) ; }
99+ self . ptr = self . ptr . wrapping_add ( index) ;
100100 self . len -= index;
101101
102102 result
@@ -161,7 +161,7 @@ pub mod arc {
161161 /// shared4.try_merge(shared2).ok().expect("Failed to merge 4 and 231");
162162 /// ```
163163 pub fn try_merge ( & mut self , other : Bytes ) -> Result < ( ) , Bytes > {
164- if Arc :: ptr_eq ( & self . sequestered , & other. sequestered ) && :: std:: ptr:: eq ( unsafe { self . ptr . add ( self . len ) } , other. ptr ) {
164+ if Arc :: ptr_eq ( & self . sequestered , & other. sequestered ) && :: std:: ptr:: eq ( self . ptr . wrapping_add ( self . len ) , other. ptr ) {
165165 self . len += other. len ;
166166 Ok ( ( ) )
167167 }
You can’t perform that action at this time.
0 commit comments