File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -247,7 +247,7 @@ won’t have its methods:
247
247
[ write ] : ../std/io/trait.Write.html
248
248
249
249
``` rust,ignore
250
- let mut f = std::fs::File::open("foo.txt").ok(). expect("Couldn’t open foo.txt");
250
+ let mut f = std::fs::File::open("foo.txt").expect("Couldn’t open foo.txt");
251
251
let buf = b"whatever"; // byte string literal. buf: &[u8; 8]
252
252
let result = f.write(buf);
253
253
# result.unwrap(); // ignore the error
@@ -266,7 +266,7 @@ We need to `use` the `Write` trait first:
266
266
``` rust,ignore
267
267
use std::io::Write;
268
268
269
- let mut f = std::fs::File::open("foo.txt").ok(). expect("Couldn’t open foo.txt");
269
+ let mut f = std::fs::File::open("foo.txt").expect("Couldn’t open foo.txt");
270
270
let buf = b"whatever";
271
271
let result = f.write(buf);
272
272
# result.unwrap(); // ignore the error
You can’t perform that action at this time.
0 commit comments