diff options
| author | klensy <klensy@users.noreply.github.com> | 2021-02-25 04:13:42 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2021-02-25 04:21:12 +0300 |
| commit | 08b1e8004b06112fb8334155b2cea314bd3e8161 (patch) | |
| tree | d266e7a711f68b71ec9808b3e6caee5000f2d171 /compiler/rustc_trait_selection/src/traits | |
| parent | c75c4a579bdea69fc9b93697aa2531daf82540fc (diff) | |
fix review
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/specialize/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index 9759ab8a8a6..264cc4f248c 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -349,7 +349,7 @@ fn report_negative_positive_conflict( E0751, "found both positive and negative implementation of trait `{}`{}:", overlap.trait_desc, - overlap.self_desc.clone().map_or_else(|| String::new(), |ty| format!(" for type `{}`", ty)) + overlap.self_desc.clone().map_or_else(String::new, |ty| format!(" for type `{}`", ty)) ); match tcx.span_of_impl(negative_impl_def_id) { @@ -400,7 +400,7 @@ fn report_conflicting_impls( overlap .self_desc .clone() - .map_or_else(|| String::new(), |ty| { format!(" for type `{}`", ty) }), + .map_or_else(String::new, |ty| { format!(" for type `{}`", ty) }), match used_to_be_allowed { Some(FutureCompatOverlapErrorKind::Issue33140) => " (E0119)", _ => "", @@ -418,9 +418,7 @@ fn report_conflicting_impls( impl_span, format!( "conflicting implementation{}", - overlap - .self_desc - .map_or_else(|| String::new(), |ty| format!(" for `{}`", ty)) + overlap.self_desc.map_or_else(String::new, |ty| format!(" for `{}`", ty)) ), ); } |
