@@ -86,19 +86,6 @@ use str::FromStr;
86
86
/// `&mut Foo` or `&&mut Foo`)
87
87
///
88
88
/// # Examples
89
- /// An example implementation of the trait is [`Path`].
90
- ///
91
- /// [`Path`]: ../../std/path/struct.Path.html
92
- ///
93
- /// ```
94
- /// use std::path::Path;
95
- ///
96
- /// impl AsRef<Path> for str {
97
- /// fn as_ref(&self) -> &Path {
98
- /// Path::new(self)
99
- /// }
100
- /// }
101
- /// ```
102
89
///
103
90
/// Both [`String`] and `&str` implement `AsRef<str>`:
104
91
///
@@ -156,15 +143,6 @@ pub trait AsRef<T: ?Sized> {
156
143
/// assert_eq!(*boxed_num, 1);
157
144
/// ```
158
145
///
159
- /// `Vec` implements `AsMut` for converting between itself and a primitive array:
160
- ///
161
- /// ```
162
- /// impl<T> AsMut<[T]> for Vec<T> {
163
- /// fn as_mut(&mut self) -> &mut [T] {
164
- /// self
165
- /// }
166
- /// }
167
- /// ```
168
146
///
169
147
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
170
148
pub trait AsMut < T : ?Sized > {
@@ -275,11 +253,12 @@ pub trait Into<T>: Sized {
275
253
/// }
276
254
/// }
277
255
///
278
- /// fn open_and_parse_file(file_name: &str) -> Result<i32, MyError > {
279
- /// let file = std::fs::File::open("test")?;
256
+ /// fn open_and_parse_file(file_name: &str) -> Result<i32, CliError > {
257
+ /// let mut file = std::fs::File::open("test")?;
280
258
/// let mut contents = String::new();
281
259
/// file.read_to_string(&mut contents)?;
282
260
/// let num: i32 = contents.trim().parse()?;
261
+ /// Ok(num)
283
262
/// }
284
263
/// ```
285
264
///
0 commit comments