]> git.lizzy.rs Git - rust.git/commitdiff
Escape &str in convert docs
authorChris Gregory <czipperz@gmail.com>
Sat, 13 Apr 2019 23:14:44 +0000 (18:14 -0500)
committerChris Gregory <czipperz@gmail.com>
Sat, 13 Apr 2019 23:14:44 +0000 (18:14 -0500)
src/libcore/convert.rs

index 86846d3842c08c640ac06ca0529c2c3517d36b9f..df178e0ff0a61d77ba3470f7651f2b8719db8e3a 100644 (file)
@@ -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");