@@ -263,19 +263,19 @@ mod linux_only {
263263 use uutests:: new_ucmd;
264264
265265 fn make_broken_pipe ( ) -> File {
266- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
266+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
267267 // Drop the read end of the pipe
268268 drop ( read) ;
269- // Make the write end of the pipe into a Rust File
270- write. into ( )
269+ // Return the write end of the pipe
270+ write
271271 }
272272
273273 fn make_hanging_read ( ) -> File {
274- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
274+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
275275 // PURPOSELY leak the write end of the pipe, so the read end hangs.
276276 std:: mem:: forget ( write) ;
277277 // Return the read end of the pipe
278- read. into ( )
278+ read
279279 }
280280
281281 fn run_tee ( proc : & mut UCommand ) -> ( String , CmdResult ) {
@@ -726,10 +726,9 @@ fn test_output_error_flag_without_value_defaults_warn_nopipe() {
726726#[ cfg( all( unix, not( target_os = "freebsd" ) ) ) ]
727727#[ test]
728728fn test_output_error_presence_only_broken_pipe_unix ( ) {
729- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
729+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
730730 // Close the read end to simulate a broken pipe on stdout
731731 drop ( read) ;
732- let write: std:: fs:: File = write. into ( ) ;
733732 let content = ( 0 ..10_000 ) . map ( |_| "x" ) . collect :: < String > ( ) ;
734733 let result = new_ucmd ! ( )
735734 . arg ( "--output-error" ) // presence-only flag
@@ -745,10 +744,9 @@ fn test_output_error_presence_only_broken_pipe_unix() {
745744#[ cfg( all( unix, not( target_os = "freebsd" ) ) ) ]
746745#[ test]
747746fn test_broken_pipe_early_termination_stdout_only ( ) {
748- let ( read, write) = rustix :: pipe :: pipe ( ) . expect ( "Failed to create pipe" ) ;
747+ let ( read, write) = std :: io :: pipe ( ) . expect ( "Failed to create pipe" ) ;
749748 // Create a broken stdout
750749 drop ( read) ;
751- let write: std:: fs:: File = write. into ( ) ;
752750 let content = ( 0 ..10_000 ) . map ( |_| "x" ) . collect :: < String > ( ) ;
753751 let mut proc = new_ucmd ! ( ) ;
754752 let result = proc
0 commit comments