about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbebecue <109153518+bebecue@users.noreply.github.com>2022-11-05 04:44:02 +0800
committerGitHub <noreply@github.com>2022-11-05 04:44:02 +0800
commitf86c35c326006d2406192985e49085a3a828a1fc (patch)
treea174af5c08d0b83d68d1077457a26944a8eb16ac
parent704e00cb75ef5be2080d21be0965afd938d6fbec (diff)
downloadrust-f86c35c326006d2406192985e49085a3a828a1fc.tar.gz
rust-f86c35c326006d2406192985e49085a3a828a1fc.zip
Update lint `suspicious_to_owned`
`matches!(data, String)` will matches any type, replace it with explicit type annotation.
-rw-r--r--clippy_lints/src/methods/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs
index 43a52f15680..26834dc4fcc 100644
--- a/clippy_lints/src/methods/mod.rs
+++ b/clippy_lints/src/methods/mod.rs
@@ -2096,8 +2096,7 @@ declare_clippy_lint! {
     /// let s = "Hello world!";
     /// let cow = Cow::Borrowed(s);
     ///
-    /// let data = cow.into_owned();
-    /// assert!(matches!(data, String))
+    /// let _data: String = cow.into_owned();
     /// ```
     #[clippy::version = "1.65.0"]
     pub SUSPICIOUS_TO_OWNED,