Make From::from example more idiomatic / simpler
This commit is contained in:
parent
5fb0259edf
commit
57284e6880
1 changed files with 1 additions and 3 deletions
|
|
@ -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);
|
||||
/// ```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue