add type in help of from over Into

This commit is contained in:
Aliénore Bouttefeux 2021-04-16 19:38:01 +02:00
parent 1e0a3ff55c
commit 2d050f4b2f
2 changed files with 2 additions and 3 deletions

View file

@ -73,7 +73,7 @@ impl LateLintPass<'_> for FromOverInto {
cx.tcx.sess.source_map().guess_head_span(item.span),
"an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true",
None,
"consider to implement `From` instead",
&format!("consider to implement `From<{}>` instead", impl_trait_ref.self_ty()),
);
}
}

View file

@ -5,7 +5,6 @@ LL | impl Into<StringWrapper> for String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::from-over-into` implied by `-D warnings`
= help: consider to implement `From` instead
= help: consider to implement `From<std::string::String>` instead
error: aborting due to previous error