File tree 2 files changed +6
-3
lines changed 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -512,7 +512,9 @@ where
512
512
{
513
513
fn from_array ( nodeid : u64 , op_header : O :: InStruct , data : & [ u8 ] ) -> Box < Cmd < O > > {
514
514
let mut cmd = Self :: with_capacity ( nodeid, op_header, data. len ( ) ) ;
515
- MaybeUninit :: write_slice ( & mut cmd. payload , data) ;
515
+ for ( target, source) in cmd. payload . iter_mut ( ) . zip ( data) {
516
+ * target = MaybeUninit :: new ( * source) ;
517
+ }
516
518
unsafe { core:: intrinsics:: transmute ( cmd) }
517
519
}
518
520
}
@@ -525,7 +527,9 @@ where
525
527
let str_bytes = str. as_bytes ( ) ;
526
528
// Plus one for the NUL terminator
527
529
let mut cmd = Self :: with_capacity ( nodeid, op_header, str_bytes. len ( ) + 1 ) ;
528
- MaybeUninit :: write_slice ( & mut cmd. payload [ ..str_bytes. len ( ) ] , str_bytes) ;
530
+ for ( target, source) in cmd. payload [ ..str_bytes. len ( ) ] . iter_mut ( ) . zip ( str_bytes) {
531
+ * target = MaybeUninit :: new ( * source) ;
532
+ }
529
533
cmd. payload [ str_bytes. len ( ) ] = MaybeUninit :: new ( b'\0' ) ;
530
534
unsafe { core:: intrinsics:: transmute ( cmd) }
531
535
}
Original file line number Diff line number Diff line change 18
18
#![ feature( exposed_provenance) ]
19
19
#![ feature( linked_list_cursors) ]
20
20
#![ feature( maybe_uninit_slice) ]
21
- #![ feature( maybe_uninit_write_slice) ]
22
21
#![ feature( naked_functions) ]
23
22
#![ feature( new_uninit) ]
24
23
#![ feature( noop_waker) ]
You can’t perform that action at this time.
0 commit comments