]> git.lizzy.rs Git - rust.git/commitdiff
change error message
authordangcheng <dangcheng@hotmail.com>
Mon, 12 Sep 2016 04:02:35 +0000 (12:02 +0800)
committerGitHub <noreply@github.com>
Mon, 12 Sep 2016 04:02:35 +0000 (12:02 +0800)
src/doc/book/traits.md

index 605dc2a152df9aa6cc03d3f6e886e93a6840bc84..d07fb6b7c45bfb06a6beafa89f0f767499dee733 100644 (file)
@@ -275,7 +275,7 @@ won’t have its methods:
 [write]: ../std/io/trait.Write.html
 
 ```rust,ignore
-let mut f = std::fs::File::create("foo.txt").expect("Couldn’t open foo.txt");
+let mut f = std::fs::File::create("foo.txt").expect("Couldn’t create foo.txt");
 let buf = b"whatever"; // byte string literal. buf: &[u8; 8]
 let result = f.write(buf);
 # result.unwrap(); // ignore the error
@@ -294,7 +294,7 @@ We need to `use` the `Write` trait first:
 ```rust,ignore
 use std::io::Write;
 
-let mut f = std::fs::File::create("foo.txt").expect("Couldn’t open foo.txt");
+let mut f = std::fs::File::create("foo.txt").expect("Couldn’t create foo.txt");
 let buf = b"whatever";
 let result = f.write(buf);
 # result.unwrap(); // ignore the error