Skip to content

Commit 57284e6

Browse files
committed
Make From::from example more idiomatic / simpler
1 parent 5fb0259 commit 57284e6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libcore/convert.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ pub trait Into<T>: Sized {
8383
/// `String` implements `From<&str>`:
8484
///
8585
/// ```
86-
/// let s = "hello";
8786
/// let string = "hello".to_string();
88-
///
89-
/// let other_string: String = From::from(s);
87+
/// let other_string = String::from("hello");
9088
///
9189
/// assert_eq!(string, other_string);
9290
/// ```

0 commit comments

Comments
 (0)