Skip to content

Commit 1e48da6

Browse files
committed
Escape &str in convert docs
1 parent 27ff536 commit 1e48da6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libcore/convert.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub const fn identity<T>(x: T) -> T { x }
132132
/// converted a the specified type `T`.
133133
///
134134
/// For example: By creating a generic function that takes an `AsRef<str>` we express that we
135-
/// want to accept all references that can be converted to &str as an argument.
135+
/// want to accept all references that can be converted to `&str` as an argument.
136136
/// Since both [`String`] and `&str` implement `AsRef<str>` we can accept both as input argument.
137137
///
138138
/// [`String`]: ../../std/string/struct.String.html
@@ -312,7 +312,8 @@ pub trait Into<T>: Sized {
312312
///
313313
/// [`String`] implements `From<&str>`:
314314
///
315-
/// An explicit conversion from a &str to a String is done as follows:
315+
/// An explicit conversion from a `&str` to a String is done as follows:
316+
///
316317
/// ```
317318
/// let string = "hello".to_string();
318319
/// let other_string = String::from("hello");

0 commit comments

Comments
 (0)