File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -872,8 +872,6 @@ impl<'a> Drop for Env<'a> {
872872#[ cfg( test) ]
873873mod tests {
874874 use super :: * ;
875- use std:: fs:: File ;
876- use std:: io:: { Read , Write } ;
877875
878876 #[ test]
879877 fn parse_version ( ) {
@@ -903,22 +901,12 @@ mod tests {
903901
904902 // Create the files.
905903 for path in paths {
906- File :: options ( )
907- . write ( true )
908- . create_new ( true )
909- . open ( path)
910- . expect ( "can create file" )
911- . write_all ( CONFIG_DATA )
912- . expect ( "can write contents" ) ;
904+ std:: fs:: write ( path, CONFIG_DATA ) . expect ( "can write contents" ) ;
913905 }
914906
915907 // Verify the files. This is mostly to show we really made a `\\?\...\NUL` on Windows.
916908 for path in paths {
917- let mut buf = Vec :: with_capacity ( CONFIG_DATA . len ( ) ) ;
918- File :: open ( path)
919- . expect ( "the file really exists" )
920- . read_to_end ( & mut buf)
921- . expect ( "can read contents" ) ;
909+ let buf = std:: fs:: read ( path) . expect ( "the file really exists" ) ;
922910 assert_eq ! ( buf, CONFIG_DATA , "File {path:?} should be created" ) ;
923911 }
924912 }
You can’t perform that action at this time.
0 commit comments