@@ -182,12 +182,10 @@ pub fn test_strftime_5() {
182182 if __text. is_empty( ) || __text. len( ) + 1 > :: std:: mem:: size_of:: <[ u8 ; 64 ] >( ) {
183183 0
184184 } else {
185- let mut __dst = ( buf. as_pointer( ) as Ptr <u8 >) . clone( ) ;
186- for __b in __text. as_bytes( ) {
187- __dst. write( * __b) ;
188- __dst += 1 ;
189- }
190- __dst. write( 0 ) ;
185+ ( buf. as_pointer( ) as Ptr <u8 >) . with_slice_mut( __text. len( ) + 1 , |__s| {
186+ __s[ ..__text. len( ) ] . copy_from_slice( __text. as_bytes( ) ) ;
187+ __s[ __text. len( ) ] = 0 ;
188+ } ) ;
191189 __text. len( )
192190 }
193191 } > 0_usize ) as i32 )
@@ -210,12 +208,10 @@ pub fn test_strftime_5() {
210208 if __text. is_empty( ) || __text. len( ) + 1 > :: std:: mem:: size_of:: <[ u8 ; 64 ] >( ) {
211209 0
212210 } else {
213- let mut __dst = ( buf. as_pointer( ) as Ptr <u8 >) . clone( ) ;
214- for __b in __text. as_bytes( ) {
215- __dst. write( * __b) ;
216- __dst += 1 ;
217- }
218- __dst. write( 0 ) ;
211+ ( buf. as_pointer( ) as Ptr <u8 >) . with_slice_mut( __text. len( ) + 1 , |__s| {
212+ __s[ ..__text. len( ) ] . copy_from_slice( __text. as_bytes( ) ) ;
213+ __s[ __text. len( ) ] = 0 ;
214+ } ) ;
219215 __text. len( )
220216 }
221217 } > 0_usize ) as i32 )
@@ -238,12 +234,10 @@ pub fn test_strftime_5() {
238234 if __text. is_empty( ) || __text. len( ) + 1 > :: std:: mem:: size_of:: <[ u8 ; 64 ] >( ) {
239235 0
240236 } else {
241- let mut __dst = ( buf. as_pointer( ) as Ptr <u8 >) . clone( ) ;
242- for __b in __text. as_bytes( ) {
243- __dst. write( * __b) ;
244- __dst += 1 ;
245- }
246- __dst. write( 0 ) ;
237+ ( buf. as_pointer( ) as Ptr <u8 >) . with_slice_mut( __text. len( ) + 1 , |__s| {
238+ __s[ ..__text. len( ) ] . copy_from_slice( __text. as_bytes( ) ) ;
239+ __s[ __text. len( ) ] = 0 ;
240+ } ) ;
247241 __text. len( )
248242 }
249243 } > 0_usize ) as i32 )
@@ -264,12 +258,10 @@ pub fn test_strftime_5() {
264258 if __text. is_empty( ) || __text. len( ) + 1 > :: std:: mem:: size_of:: <[ u8 ; 64 ] >( ) {
265259 0
266260 } else {
267- let mut __dst = ( buf. as_pointer( ) as Ptr <u8 >) . clone( ) ;
268- for __b in __text. as_bytes( ) {
269- __dst. write( * __b) ;
270- __dst += 1 ;
271- }
272- __dst. write( 0 ) ;
261+ ( buf. as_pointer( ) as Ptr <u8 >) . with_slice_mut( __text. len( ) + 1 , |__s| {
262+ __s[ ..__text. len( ) ] . copy_from_slice( __text. as_bytes( ) ) ;
263+ __s[ __text. len( ) ] = 0 ;
264+ } ) ;
273265 __text. len( )
274266 }
275267 } > 0_usize ) as i32 )
@@ -295,12 +287,10 @@ pub fn test_strftime_5() {
295287 if __text. is_empty( ) || __text. len( ) + 1 > :: std:: mem:: size_of:: <[ u8 ; 4 ] >( ) {
296288 0
297289 } else {
298- let mut __dst = ( small. as_pointer( ) as Ptr <u8 >) . clone( ) ;
299- for __b in __text. as_bytes( ) {
300- __dst. write( * __b) ;
301- __dst += 1 ;
302- }
303- __dst. write( 0 ) ;
290+ ( small. as_pointer( ) as Ptr <u8 >) . with_slice_mut( __text. len( ) + 1 , |__s| {
291+ __s[ ..__text. len( ) ] . copy_from_slice( __text. as_bytes( ) ) ;
292+ __s[ __text. len( ) ] = 0 ;
293+ } ) ;
304294 __text. len( )
305295 }
306296 } == 0_usize ) as i32 )
0 commit comments