From 1e48da6c81ba407b83189adff90abbd224dc1b62 Mon Sep 17 00:00:00 2001 From: Chris Gregory Date: Sat, 13 Apr 2019 18:14:44 -0500 Subject: [PATCH] Escape &str in convert docs --- src/libcore/convert.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index 86846d3842c08..df178e0ff0a61 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -132,7 +132,7 @@ pub const fn identity(x: T) -> T { x } /// converted a the specified type `T`. /// /// For example: By creating a generic function that takes an `AsRef` 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` we can accept both as input argument. /// /// [`String`]: ../../std/string/struct.String.html @@ -312,7 +312,8 @@ pub trait Into: 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");