about summary refs log tree commit diff
path: root/src/libcore/convert.rs
diff options
context:
space:
mode:
authorDylan Maccora <maccora17@gmail.com>2017-04-07 18:26:36 +1000
committerDylan Maccora <maccora17@gmail.com>2017-04-08 08:12:50 +1000
commitd35fa1e98b244773129f18b0e8bcc81fa099ae68 (patch)
tree936506a287f4f1ffa2d86c7380c2b1d59817038d /src/libcore/convert.rs
parentbb8474682366592fa9d52cb11723a5fd5cd9421e (diff)
downloadrust-d35fa1e98b244773129f18b0e8bcc81fa099ae68.tar.gz
rust-d35fa1e98b244773129f18b0e8bcc81fa099ae68.zip
Removing broken examples
Diffstat (limited to 'src/libcore/convert.rs')
-rw-r--r--src/libcore/convert.rs27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 0bc05506413..abab4bb0f63 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -86,19 +86,6 @@ use str::FromStr;
 /// `&mut Foo` or `&&mut Foo`)
 ///
 /// # Examples
-/// An example implementation of the trait is [`Path`].
-///
-/// [`Path`]: ../../std/path/struct.Path.html
-///
-/// ```
-/// use std::path::Path;
-///
-/// impl AsRef<Path> for str {
-///     fn as_ref(&self) -> &Path {
-///         Path::new(self)
-///     }
-/// }
-/// ```
 ///
 /// Both [`String`] and `&str` implement `AsRef<str>`:
 ///
@@ -156,15 +143,6 @@ pub trait AsRef<T: ?Sized> {
 /// assert_eq!(*boxed_num, 1);
 /// ```
 ///
-/// `Vec` implements `AsMut` for converting between itself and a primitive array:
-///
-/// ```
-/// impl<T> AsMut<[T]> for Vec<T> {
-///   fn as_mut(&mut self) -> &mut [T] {
-///     self
-///   }
-/// }
-/// ```
 ///
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait AsMut<T: ?Sized> {
@@ -275,11 +253,12 @@ pub trait Into<T>: Sized {
 ///     }
 /// }
 ///
-/// fn open_and_parse_file(file_name: &str) -> Result<i32, MyError> {
-///     let file = std::fs::File::open("test")?;
+/// fn open_and_parse_file(file_name: &str) -> Result<i32, CliError> {
+///     let mut file = std::fs::File::open("test")?;
 ///     let mut contents = String::new();
 ///     file.read_to_string(&mut contents)?;
 ///     let num: i32 = contents.trim().parse()?;
+///     Ok(num)
 /// }
 /// ```
 ///