Skip to content

Commit d7fcd21

Browse files
author
Christian
committed
Changed inline code by using a single quote.
1 parent a66fca4 commit d7fcd21

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/libcore/convert.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub const fn identity<T>(x: T) -> T { x }
101101
/// Used to do a cheap reference-to-reference conversion.
102102
/// This trait is similar to [`AsMut`] which is used for converting between mutable references.
103103
/// If you need to do a costly conversion it is better to implement [`From`] with type
104-
/// ```&T``` or write a custom function.
104+
/// `&T` or write a custom function.
105105
///
106106
///
107107
/// `AsRef` is very similar to, but serves a slightly different purpose than [`Borrow`]:
@@ -126,8 +126,8 @@ pub const fn identity<T>(x: T) -> T { x }
126126
/// # Examples
127127
///
128128
/// By using trait bounds we can accept arguments of different types as long as they can be
129-
/// converted a the specified type ```T```.
130-
/// For example: By creating a generic function that takes an ```AsRef<str>``` we express that we
129+
/// converted a the specified type `T`.
130+
/// For example: By creating a generic function that takes an `AsRef<str>` we express that we
131131
/// want to accept all references that can be converted to &str as an argument.
132132
/// Since both [`String`] and `&str` implement `AsRef<str>` we can accept both as input argument.
133133
///
@@ -155,7 +155,7 @@ pub trait AsRef<T: ?Sized> {
155155
/// Used to do a cheap mutable-to-mutable reference conversion.
156156
/// This trait is similar to [`AsRef`] but used for converting between mutable
157157
/// references. If you need to do a costly conversion it is better to
158-
/// implement [`From`] with type ```&mut T``` or write a custom function.
158+
/// implement [`From`] with type `&mut T` or write a custom function.
159159
///
160160
/// **Note: This trait must not fail**. If the conversion can fail, use a
161161
/// dedicated method which returns an [`Option<T>`] or a [`Result<T, E>`].
@@ -171,11 +171,11 @@ pub trait AsRef<T: ?Sized> {
171171
///
172172
/// # Examples
173173
///
174-
/// Using ```AsMut``` as trait bound for a generic function we can accept all mutable references
175-
/// that can be converted to type ```&mut T```. Because [`Box<T>`] implements ```AsMut<T>``` we can
176-
/// write a function ```add_one```that takes all arguments that can be converted to ```&mut u64```.
177-
/// Because [`Box<T>`] implements ```AsMut<T>``` ```add_one``` accepts arguments of type
178-
/// ```&mut Box<u64>``` as well:
174+
/// Using `AsMut` as trait bound for a generic function we can accept all mutable references
175+
/// that can be converted to type `&mut T`. Because [`Box<T>`] implements `AsMut<T>` we can
176+
/// write a function `add_one`that takes all arguments that can be converted to `&mut u64`.
177+
/// Because [`Box<T>`] implements `AsMut<T>` `add_one` accepts arguments of type
178+
/// `&mut Box<u64>` as well:
179179
/// ```
180180
/// fn add_one<T: AsMut<u64>>(num: &mut T) {
181181
/// *num.as_mut() += 1;
@@ -236,20 +236,20 @@ pub trait AsMut<T: ?Sized> {
236236
/// }
237237
/// ```
238238
///
239-
/// It is important to understand that ```Into``` does not provide a [`From`] implementation
240-
/// (as [`From`] does with ```Into```). Therefore, you should always try to implement [`From`]
239+
/// It is important to understand that `Into` does not provide a [`From`] implementation
240+
/// (as [`From`] does with `Into`). Therefore, you should always try to implement [`From`]
241241
/// and then fall back to `Into` if [`From`] can't be implemented.
242-
/// Prefer using ```Into``` over ```From``` when specifying trait bounds on a generic function
243-
/// to ensure that types that only implement ```Into``` can be used as well.
242+
/// Prefer using `Into` over [`From`] when specifying trait bounds on a generic function
243+
/// to ensure that types that only implement `Into` can be used as well.
244244
///
245245
/// # Examples
246246
///
247247
/// [`String`] implements `Into<Vec<u8>>`:
248248
///
249249
/// In order to express that we want a generic function to take all arguments that can be
250-
/// converted to a specified type ```T```, we can use a trait bound of ```Into<T>```.
251-
/// For example: The function ```is_hello``` takes all arguments that can be converted into a
252-
/// ```Vec<u8>```.
250+
/// converted to a specified type `T`, we can use a trait bound of `Into<T>`.
251+
/// For example: The function `is_hello` takes all arguments that can be converted into a
252+
/// `Vec<u8>`.
253253
///
254254
/// ```
255255
/// fn is_hello<T: Into<Vec<u8>>>(s: T) {
@@ -312,13 +312,13 @@ pub trait Into<T>: Sized {
312312
/// assert_eq!(string, other_string);
313313
/// ```
314314
///
315-
/// While performing error handling it is often useful to implement ```From```
315+
/// While performing error handling it is often useful to implement `From`
316316
/// for your own error type. By converting underlying error types to our own custom error type
317317
/// that encapsulates the underlying error type, we can return a single error type
318318
/// without losing information on the underlying cause. The '?' operator automatically converts
319-
/// the underlying error type to our custom error type by calling ```Into<CliError>::into```
320-
/// which is automatically provided when implementing ```From```.
321-
/// The compiler then infers which implementation of ```Into``` should be used.
319+
/// the underlying error type to our custom error type by calling `Into<CliError>::into`
320+
/// which is automatically provided when implementing `From`.
321+
/// The compiler then infers which implementation of `Into` should be used.
322322
///
323323
/// ```
324324
/// use std::fs;

0 commit comments

Comments
 (0)