File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -3609,7 +3609,7 @@ declare_clippy_lint! {
36093609
36103610declare_clippy_lint ! {
36113611 /// ### What it does
3612- /// Checks for usage of `as_str()` on a `String`` chained with a method available on the `String` itself.
3612+ /// Checks for usage of `as_str()` on a `String` chained with a method available on the `String` itself.
36133613 ///
36143614 /// ### Why is this bad?
36153615 /// The `as_str()` conversion is pointless and can be removed for simplicity and cleanliness.
@@ -3618,14 +3618,16 @@ declare_clippy_lint! {
36183618 /// ```no_run
36193619 /// # #![allow(unused)]
36203620 /// let owned_string = "This is a string".to_owned();
3621- /// owned_string.as_str().as_bytes();
3621+ /// owned_string.as_str().as_bytes()
3622+ /// # ;
36223623 /// ```
36233624 ///
36243625 /// Use instead:
36253626 /// ```no_run
36263627 /// # #![allow(unused)]
36273628 /// let owned_string = "This is a string".to_owned();
3628- /// owned_string.as_bytes();
3629+ /// owned_string.as_bytes()
3630+ /// # ;
36293631 /// ```
36303632 #[ clippy:: version = "1.74.0" ]
36313633 pub REDUNDANT_AS_STR ,
Original file line number Diff line number Diff line change @@ -9,19 +9,22 @@ use rustc_span::sym;
99
1010declare_clippy_lint ! {
1111 /// ### What it does
12- /// Suggest removing the use of a map (or map_err) method when an Option or Result is being constructed.
12+ /// Suggests removing the use of a `map()` (or `map_err()`) method when an `Option` or `Result`
13+ /// is being constructed.
1314 ///
1415 /// ### Why is this bad?
1516 /// It introduces unnecessary complexity. In this case the function can be used directly and
16- /// construct the Option or Result from the output.
17+ /// construct the ` Option` or ` Result` from the output.
1718 ///
1819 /// ### Example
1920 /// ```no_run
20- /// Some(4).map(i32::swap_bytes);
21+ /// Some(4).map(i32::swap_bytes)
22+ /// # ;
2123 /// ```
2224 /// Use instead:
2325 /// ```no_run
24- /// Some(i32::swap_bytes(4));
26+ /// Some(i32::swap_bytes(4))
27+ /// # ;
2528 /// ```
2629 #[ clippy:: version = "1.74.0" ]
2730 pub UNNECESSARY_MAP_ON_CONSTRUCTOR ,
You can’t perform that action at this time.
0 commit comments