diff options
| author | Chris Gregory <czipperz@gmail.com> | 2019-04-13 18:14:44 -0500 |
|---|---|---|
| committer | Chris Gregory <czipperz@gmail.com> | 2019-04-13 18:14:44 -0500 |
| commit | 1e48da6c81ba407b83189adff90abbd224dc1b62 (patch) | |
| tree | 027d9571cc9348060ee42540731d8c627f0540b4 | |
| parent | 27ff5360ab661a3c20ab7256529aeb61b4e2b215 (diff) | |
| download | rust-1e48da6c81ba407b83189adff90abbd224dc1b62.tar.gz rust-1e48da6c81ba407b83189adff90abbd224dc1b62.zip | |
Escape &str in convert docs
| -rw-r--r-- | src/libcore/convert.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 86846d3842c..df178e0ff0a 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -132,7 +132,7 @@ pub const fn identity<T>(x: T) -> T { x } /// converted a the specified type `T`. /// /// For example: By creating a generic function that takes an `AsRef<str>` we express that we -/// want to accept all references that can be converted to &str as an argument. +/// want to accept all references that can be converted to `&str` as an argument. /// Since both [`String`] and `&str` implement `AsRef<str>` we can accept both as input argument. /// /// [`String`]: ../../std/string/struct.String.html @@ -312,7 +312,8 @@ pub trait Into<T>: Sized { /// /// [`String`] implements `From<&str>`: /// -/// An explicit conversion from a &str to a String is done as follows: +/// An explicit conversion from a `&str` to a String is done as follows: +/// /// ``` /// let string = "hello".to_string(); /// let other_string = String::from("hello"); |
