File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/tools/miri/tests/pass-dep/tokio Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ async fn test_create_and_write() -> io::Result<()> {
20
20
let mut file = File :: create ( & path) . await ?;
21
21
22
22
// Write 10 bytes to the file.
23
- file. write ( b"some bytes" ) . await ?;
23
+ file. write_all ( b"some bytes" ) . await ?;
24
24
assert_eq ! ( file. metadata( ) . await . unwrap( ) . len( ) , 10 ) ;
25
25
26
26
remove_file ( & path) . unwrap ( ) ;
@@ -31,10 +31,10 @@ async fn test_create_and_read() -> io::Result<()> {
31
31
let bytes = b"more bytes" ;
32
32
let path = utils:: prepare_with_content ( "foo.txt" , bytes) ;
33
33
let mut file = OpenOptions :: new ( ) . read ( true ) . open ( & path) . await . unwrap ( ) ;
34
- let mut buffer = [ 0u8 ; 10 ] ;
34
+ let mut buffer = vec ! [ ] ;
35
35
36
36
// Read the whole file.
37
- file. read ( & mut buffer[ .. ] ) . await ?;
37
+ file. read_to_end ( & mut buffer) . await ?;
38
38
assert_eq ! ( & buffer, b"more bytes" ) ;
39
39
40
40
remove_file ( & path) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments