@@ -86,19 +86,6 @@ use str::FromStr;
8686/// `&mut Foo` or `&&mut Foo`)
8787///
8888/// # 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- /// ```
10289///
10390/// Both [`String`] and `&str` implement `AsRef<str>`:
10491///
@@ -156,15 +143,6 @@ pub trait AsRef<T: ?Sized> {
156143/// assert_eq!(*boxed_num, 1);
157144/// ```
158145///
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- /// ```
168146///
169147#[ stable( feature = "rust1" , since = "1.0.0" ) ]
170148pub trait AsMut < T : ?Sized > {
@@ -275,11 +253,12 @@ pub trait Into<T>: Sized {
275253/// }
276254/// }
277255///
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")?;
280258/// let mut contents = String::new();
281259/// file.read_to_string(&mut contents)?;
282260/// let num: i32 = contents.trim().parse()?;
261+ /// Ok(num)
283262/// }
284263/// ```
285264///
0 commit comments