We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 366de83 commit 8f3e498Copy full SHA for 8f3e498
src/libcore/result.rs
@@ -175,8 +175,11 @@
175
//! }
176
//!
177
//! fn write_info(info: &Info) -> io::Result<()> {
178
-//! let mut file = try!(File::create("my_best_friends.txt"));
179
//! // Early return on error
+//! let mut file = match File::create("my_best_friends.txt") {
180
+//! Err(e) => return Err(e),
181
+//! Ok(f) => f,
182
+//! };
183
//! if let Err(e) = file.write_all(format!("name: {}\n", info.name).as_bytes()) {
184
//! return Err(e)
185
0 commit comments