]> git.lizzy.rs Git - rust.git/commitdiff
Remove unnecessary returns in API examples
authorCorey Farwell <coreyf@rwell.org>
Mon, 6 Apr 2015 07:06:24 +0000 (00:06 -0700)
committerCorey Farwell <coreyf@rwell.org>
Mon, 6 Apr 2015 07:06:24 +0000 (00:06 -0700)
src/libcore/result.rs

index 47a8bf838997dffcb91a69127093844fec384757..67a5ab891f72ca2b2ba840929bd3fe5806f2be04 100644 (file)
 //!     let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
 //!     try!(file.write_line("important message"));
 //!     drop(file);
-//!     return Ok(());
+//!     Ok(())
 //! }
 //! ```
 //!
 //!     if let Err(e) = file.write_line(&format!("age: {}", info.age)) {
 //!         return Err(e)
 //!     }
-//!     return file.write_line(&format!("rating: {}", info.rating));
+//!     file.write_line(&format!("rating: {}", info.rating))
 //! }
 //! ```
 //!
 //!     try!(file.write_line(&format!("name: {}", info.name)));
 //!     try!(file.write_line(&format!("age: {}", info.age)));
 //!     try!(file.write_line(&format!("rating: {}", info.rating)));
-//!     return Ok(());
+//!     Ok(())
 //! }
 //! ```
 //!