]> git.lizzy.rs Git - rust.git/commitdiff
Remove main() from examples
authorSon <leson.phung@gmail.com>
Tue, 2 Oct 2018 22:25:31 +0000 (08:25 +1000)
committerSon <leson.phung@gmail.com>
Tue, 2 Oct 2018 22:25:31 +0000 (08:25 +1000)
src/libstd/io/error.rs

index cf5b9c75e9fc97a0a0ac32a8f8dabf79544c0398..6515a5540eeb91f048922b4f36f21b4370fbe89f 100644 (file)
@@ -221,11 +221,9 @@ impl From<ErrorKind> for Error {
     /// ```
     /// use std::io::{Error, ErrorKind};
     ///
-    /// fn main() {
-    ///     let not_found = ErrorKind::NotFound;
-    ///     let error = Error::from(not_found);
-    ///     assert_eq!("entity not found", format!("{}", error));
-    /// }
+    /// let not_found = ErrorKind::NotFound;
+    /// let error = Error::from(not_found);
+    /// assert_eq!("entity not found", format!("{}", error));
     /// ```
     #[inline]
     fn from(kind: ErrorKind) -> Error {