We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 064c21e commit 1217007Copy full SHA for 1217007
src/libcore/result.rs
@@ -178,13 +178,11 @@
178
//! fn write_info(info: &Info) -> Result<(), IoError> {
179
//! let mut file = File::open_mode(&Path::new("my_best_friends.txt"), Open, Write);
180
//! // Early return on error
181
-//! match file.write_line(format!("name: {}", info.name).as_slice()) {
182
-//! Ok(_) => (),
183
-//! Err(e) => return Err(e)
+//! if let Err(e) = file.write_line(format!("name: {}", info.name).as_slice()) {
+//! return Err(e)
184
//! }
185
-//! match file.write_line(format!("age: {}", info.age).as_slice()) {
186
187
+//! if let Err(e) = file.write_line(format!("age: {}", info.age).as_slice()) {
188
189
//! return file.write_line(format!("rating: {}", info.rating).as_slice());
190
0 commit comments