File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 52
52
//! use std::error::FromError;
53
53
//! use std::{io, str};
54
54
//! use std::fs::File;
55
- //!
55
+ //!
56
56
//! enum MyError { Io(io::Error), Utf8(str::Utf8Error), }
57
- //!
57
+ //!
58
58
//! impl FromError<io::Error> for MyError {
59
59
//! fn from_error(err: io::Error) -> MyError { MyError::Io(err) }
60
60
//! }
61
- //!
61
+ //!
62
62
//! impl FromError<str::Utf8Error> for MyError {
63
63
//! fn from_error(err: str::Utf8Error) -> MyError { MyError::Utf8(err) }
64
64
//! }
65
- //!
65
+ //!
66
66
//! #[allow(unused_variables)]
67
67
//! fn open_and_map() -> Result<(), MyError> {
68
68
//! let b = b"foo.txt";
69
69
//! let s = try!(str::from_utf8(b));
70
70
//! let f = try!(File::open(s));
71
- //!
71
+ //!
72
72
//! // do something interesting here...
73
73
//! Ok(())
74
74
//! }
You can’t perform that action at this time.
0 commit comments