Skip to content

Commit f86c35c

Browse files
authored
Update lint suspicious_to_owned
`matches!(data, String)` will matches any type, replace it with explicit type annotation.
1 parent 704e00c commit f86c35c

File tree

1 file changed

+1
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+1
-2
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,8 +2096,7 @@ declare_clippy_lint! {
20962096
/// let s = "Hello world!";
20972097
/// let cow = Cow::Borrowed(s);
20982098
///
2099-
/// let data = cow.into_owned();
2100-
/// assert!(matches!(data, String))
2099+
/// let _data: String = cow.into_owned();
21012100
/// ```
21022101
#[clippy::version = "1.65.0"]
21032102
pub SUSPICIOUS_TO_OWNED,

0 commit comments

Comments
 (0)