From b91713e82453f8afab4b37ed259b99381333e0ce Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 24 Jan 2021 16:04:28 -0800 Subject: [PATCH] Suppress clippy should_implement_trait lint I think there is no ambiguity in from_str as a method name so "choose a less ambiguous method name" is unnecessary, and it can't be a FromStr impl in this case because FromStr's error type cannot borrow from the input string slice. warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` --> serde_derive_internals/src/case.rs:50:5 | 50 | / pub fn from_str(rename_all_str: &str) -> Result { 51 | | for (name, rule) in RENAME_RULES { 52 | | if rename_all_str == *name { 53 | | return Ok(*rule); ... | 58 | | }) 59 | | } | |_____^ | = note: `#[warn(clippy::should_implement_trait)]` on by default = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait --- serde_derive_internals/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/serde_derive_internals/lib.rs b/serde_derive_internals/lib.rs index 5bc767569..576e81a10 100644 --- a/serde_derive_internals/lib.rs +++ b/serde_derive_internals/lib.rs @@ -7,6 +7,7 @@ cognitive_complexity, redundant_field_names, result_unit_err, + should_implement_trait, trivially_copy_pass_by_ref, wildcard_in_or_patterns, // clippy bug: https://github.com/rust-lang/rust-clippy/issues/5704