about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2015-04-26 23:18:19 -0400
committerCorey Farwell <coreyf@rwell.org>2015-04-26 23:18:19 -0400
commit57284e68803c820ea8d453ed9711e065d2fb3b49 (patch)
tree779a3e24d99047b1e432b3b9fc883449154c82b6
parent5fb0259edfbc4034cfbcf827ab91d6118b7ae848 (diff)
downloadrust-57284e68803c820ea8d453ed9711e065d2fb3b49.tar.gz
rust-57284e68803c820ea8d453ed9711e065d2fb3b49.zip
Make From::from example more idiomatic / simpler
-rw-r--r--src/libcore/convert.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index d9cda58d9eb..d3de77a9241 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -83,10 +83,8 @@ pub trait Into<T>: Sized {
 /// `String` implements `From<&str>`:
 ///
 /// ```
-/// let s = "hello";
 /// let string = "hello".to_string();
-///
-/// let other_string: String = From::from(s);
+/// let other_string = String::from("hello");
 ///
 /// assert_eq!(string, other_string);
 /// ```