From f86c35c326006d2406192985e49085a3a828a1fc Mon Sep 17 00:00:00 2001 From: bebecue <109153518+bebecue@users.noreply.github.com> Date: Sat, 5 Nov 2022 04:44:02 +0800 Subject: [PATCH] Update lint `suspicious_to_owned` `matches!(data, String)` will matches any type, replace it with explicit type annotation. --- clippy_lints/src/methods/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index 43a52f156809..26834dc4fcc6 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,