File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -214,10 +214,19 @@ impl ErrorKind {
214214impl From < ErrorKind > for Error {
215215 /// Converts a [`ErrorKind`] into a [`Error`].
216216 ///
217- /// This conversion allocates a new error with simple repr .
217+ /// This conversion allocates a new error with a simple representation of error kind .
218218 ///
219- /// [`ErrorKind`]: enum.ErrorKind.html
220- /// [`Error`]: struct.Error.html
219+ /// # Examples
220+ ///
221+ /// ```
222+ /// use std::io::{Error, ErrorKind};
223+ ///
224+ /// fn main() {
225+ /// let not_found = ErrorKind::NotFound;
226+ /// let error = Error::from(not_found);
227+ /// assert_eq!("entity not found", format!("{}", error));
228+ /// }
229+ /// ```
221230 #[ inline]
222231 fn from ( kind : ErrorKind ) -> Error {
223232 Error {
You can’t perform that action at this time.
0 commit comments