@@ -89,11 +89,11 @@ pub unsafe trait RawDataClone: RawData
8989
9090 #[ doc( hidden) ]
9191 unsafe fn clone_from_with_ptr ( & mut self , other : & Self , ptr : NonNull < Self :: Elem > ) -> NonNull < Self :: Elem >
92- { unsafe {
92+ {
9393 let ( data, ptr) = other. clone_with_ptr ( ptr) ;
9494 * self = data;
9595 ptr
96- } }
96+ }
9797}
9898
9999/// Array representation trait.
@@ -388,26 +388,26 @@ unsafe impl<A> RawDataClone for OwnedRepr<A>
388388where A : Clone
389389{
390390 unsafe fn clone_with_ptr ( & self , ptr : NonNull < Self :: Elem > ) -> ( Self , NonNull < Self :: Elem > )
391- { unsafe {
391+ {
392392 let mut u = self . clone ( ) ;
393393 let mut new_ptr = u. as_nonnull_mut ( ) ;
394394 if size_of :: < A > ( ) != 0 {
395395 let our_off = ( ptr. as_ptr ( ) as isize - self . as_ptr ( ) as isize ) / mem:: size_of :: < A > ( ) as isize ;
396396 new_ptr = new_ptr. offset ( our_off) ;
397397 }
398398 ( u, new_ptr)
399- } }
399+ }
400400
401401 unsafe fn clone_from_with_ptr ( & mut self , other : & Self , ptr : NonNull < Self :: Elem > ) -> NonNull < Self :: Elem >
402- { unsafe {
402+ {
403403 let our_off = if size_of :: < A > ( ) != 0 {
404404 ( ptr. as_ptr ( ) as isize - other. as_ptr ( ) as isize ) / mem:: size_of :: < A > ( ) as isize
405405 } else {
406406 0
407407 } ;
408408 self . clone_from ( other) ;
409409 self . as_nonnull_mut ( ) . offset ( our_off)
410- } }
410+ }
411411}
412412
413413unsafe impl < A > RawData for ViewRepr < & A >
@@ -622,7 +622,7 @@ unsafe impl<A> RawDataClone for CowRepr<'_, A>
622622where A : Clone
623623{
624624 unsafe fn clone_with_ptr ( & self , ptr : NonNull < Self :: Elem > ) -> ( Self , NonNull < Self :: Elem > )
625- { unsafe {
625+ {
626626 match self {
627627 CowRepr :: View ( view) => {
628628 let ( new_view, ptr) = view. clone_with_ptr ( ptr) ;
@@ -633,10 +633,10 @@ where A: Clone
633633 ( CowRepr :: Owned ( new_data) , ptr)
634634 }
635635 }
636- } }
636+ }
637637
638638 unsafe fn clone_from_with_ptr ( & mut self , other : & Self , ptr : NonNull < Self :: Elem > ) -> NonNull < Self :: Elem >
639- { unsafe {
639+ {
640640 match ( & mut * self , other) {
641641 ( CowRepr :: View ( self_) , CowRepr :: View ( other) ) => self_. clone_from_with_ptr ( other, ptr) ,
642642 ( CowRepr :: Owned ( self_) , CowRepr :: Owned ( other) ) => self_. clone_from_with_ptr ( other, ptr) ,
@@ -651,7 +651,7 @@ where A: Clone
651651 ptr
652652 }
653653 }
654- } }
654+ }
655655}
656656
657657unsafe impl < ' a , A > Data for CowRepr < ' a , A >
@@ -731,19 +731,19 @@ impl<A, B> RawDataSubst<B> for OwnedRepr<A>
731731 type Output = OwnedRepr < B > ;
732732
733733 unsafe fn data_subst ( self ) -> Self :: Output
734- { unsafe {
734+ {
735735 self . data_subst ( )
736- } }
736+ }
737737}
738738
739739impl < A , B > RawDataSubst < B > for OwnedArcRepr < A >
740740{
741741 type Output = OwnedArcRepr < B > ;
742742
743743 unsafe fn data_subst ( self ) -> Self :: Output
744- { unsafe {
744+ {
745745 OwnedArcRepr ( Arc :: from_raw ( Arc :: into_raw ( self . 0 ) as * const OwnedRepr < B > ) )
746- } }
746+ }
747747}
748748
749749impl < A , B > RawDataSubst < B > for RawViewRepr < * const A >
@@ -791,10 +791,10 @@ impl<'a, A: 'a, B: 'a> RawDataSubst<B> for CowRepr<'a, A>
791791 type Output = CowRepr < ' a , B > ;
792792
793793 unsafe fn data_subst ( self ) -> Self :: Output
794- { unsafe {
794+ {
795795 match self {
796796 CowRepr :: View ( view) => CowRepr :: View ( view. data_subst ( ) ) ,
797797 CowRepr :: Owned ( owned) => CowRepr :: Owned ( owned. data_subst ( ) ) ,
798798 }
799- } }
799+ }
800800}
0 commit comments