@@ -163,11 +163,12 @@ use boxed::Box;
163
163
/// [`&str`]s as arguments unless they need a `String` for some specific
164
164
/// reason.
165
165
///
166
- /// In certain cases Rust doesn't have enough information to make this conversion,
167
- /// known as deref coercion. For example, in this case a string slice implements
168
- /// a trait and the function takes anything that implements the trait, Rust would
169
- /// need to make two implicit conversions which Rust doesn't know how to do. The
170
- /// following example will not compile for that reason.
166
+ /// In certain cases Rust doesn't have enough information to make this
167
+ /// conversion, known as deref coercion. In the following example a string
168
+ /// slice `&'a str` implements the trait `TraitExample`, and the function
169
+ /// `example_func` takes anything that implements the trait. In this case Rust
170
+ /// would need to make two implicit conversions, which Rust doesn't have the
171
+ /// means to do. For that reason, the following example will not compile.
171
172
///
172
173
/// ```compile_fail,E0277
173
174
/// trait TraitExample {}
@@ -182,9 +183,10 @@ use boxed::Box;
182
183
/// }
183
184
/// ```
184
185
///
185
- /// What would work in this case is changing the line `example_func(&example_string);`
186
- /// to `example_func(example_string.to_str());`. This works because we're doing the
187
- /// conversion explicitly, rather than relying on the implicit conversion.
186
+ /// What would work in this case is changing the line
187
+ /// `example_func(&example_string);` to
188
+ /// `example_func(example_string.to_str());`. This works because we're doing
189
+ /// the conversion explicitly, rather than relying on the implicit conversion.
188
190
///
189
191
/// # Representation
190
192
///
0 commit comments