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<Self, ParseError> {
    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
This commit is contained in:
David Tolnay 2021-01-24 16:04:28 -08:00
parent 6ea446fb4b
commit b91713e824
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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