about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Zhang <hmperson1@gmail.com>2019-10-17 19:11:51 -0400
committerHMPerson1 <hmperson1@gmail.com>2019-10-17 19:13:32 -0400
commit2106a239669ec2ffbf3ccec98fbc88442d5c001f (patch)
tree2c1f9c9d5109d0bb59ebc36fc85f775fb26ed9ca
parentffb53e74571f4b179f265b846cfa443e527621fb (diff)
downloadrust-2106a239669ec2ffbf3ccec98fbc88442d5c001f.tar.gz
rust-2106a239669ec2ffbf3ccec98fbc88442d5c001f.zip
Update help text in `inefficient_to_string`
Co-Authored-By: Manish Goregaokar <manishsmail@gmail.com>
-rw-r--r--clippy_lints/src/methods/inefficient_to_string.rs2
-rw-r--r--tests/ui/inefficient_to_string.stderr12
2 files changed, 7 insertions, 7 deletions
diff --git a/clippy_lints/src/methods/inefficient_to_string.rs b/clippy_lints/src/methods/inefficient_to_string.rs
index 35c634cc52d..9e87ab3ad3a 100644
--- a/clippy_lints/src/methods/inefficient_to_string.rs
+++ b/clippy_lints/src/methods/inefficient_to_string.rs
@@ -24,7 +24,7 @@ pub fn lint<'tcx>(cx: &LateContext<'_, 'tcx>, expr: &hir::Expr, arg: &hir::Expr,
                 &format!("calling `to_string` on `{}`", arg_ty),
                 |db| {
                     db.help(&format!(
-                        "`{}` implements `ToString` through the blanket impl, but `{}` specializes `ToString` directly",
+                        "`{}` implements `ToString` through a slower blanket impl, but `{}` has a fast specialization of `ToString`",
                         self_ty, deref_self_ty
                     ));
                     let mut applicability = Applicability::MachineApplicable;
diff --git a/tests/ui/inefficient_to_string.stderr b/tests/ui/inefficient_to_string.stderr
index 3c2f64c805f..20788f6f6cc 100644
--- a/tests/ui/inefficient_to_string.stderr
+++ b/tests/ui/inefficient_to_string.stderr
@@ -9,7 +9,7 @@ note: lint level defined here
    |
 LL | #![deny(clippy::inefficient_to_string)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = help: `&str` implements `ToString` through the blanket impl, but `str` specializes `ToString` directly
+   = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&&str`
   --> $DIR/inefficient_to_string.rs:13:21
@@ -17,7 +17,7 @@ error: calling `to_string` on `&&&str`
 LL |     let _: String = rrrstr.to_string();
    |                     ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstr).to_string()`
    |
-   = help: `&&str` implements `ToString` through the blanket impl, but `str` specializes `ToString` directly
+   = help: `&&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&std::string::String`
   --> $DIR/inefficient_to_string.rs:21:21
@@ -25,7 +25,7 @@ error: calling `to_string` on `&&std::string::String`
 LL |     let _: String = rrstring.to_string();
    |                     ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstring).to_string()`
    |
-   = help: `&std::string::String` implements `ToString` through the blanket impl, but `std::string::String` specializes `ToString` directly
+   = help: `&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&&std::string::String`
   --> $DIR/inefficient_to_string.rs:22:21
@@ -33,7 +33,7 @@ error: calling `to_string` on `&&&std::string::String`
 LL |     let _: String = rrrstring.to_string();
    |                     ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstring).to_string()`
    |
-   = help: `&&std::string::String` implements `ToString` through the blanket impl, but `std::string::String` specializes `ToString` directly
+   = help: `&&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&std::borrow::Cow<'_, str>`
   --> $DIR/inefficient_to_string.rs:30:21
@@ -41,7 +41,7 @@ error: calling `to_string` on `&&std::borrow::Cow<'_, str>`
 LL |     let _: String = rrcow.to_string();
    |                     ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrcow).to_string()`
    |
-   = help: `&std::borrow::Cow<'_, str>` implements `ToString` through the blanket impl, but `std::borrow::Cow<'_, str>` specializes `ToString` directly
+   = help: `&std::borrow::Cow<'_, str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<'_, str>` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&&std::borrow::Cow<'_, str>`
   --> $DIR/inefficient_to_string.rs:31:21
@@ -49,7 +49,7 @@ error: calling `to_string` on `&&&std::borrow::Cow<'_, str>`
 LL |     let _: String = rrrcow.to_string();
    |                     ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrcow).to_string()`
    |
-   = help: `&&std::borrow::Cow<'_, str>` implements `ToString` through the blanket impl, but `std::borrow::Cow<'_, str>` specializes `ToString` directly
+   = help: `&&std::borrow::Cow<'_, str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<'_, str>` has a fast specialization of `ToString`
 
 error: aborting due to 6 previous errors