From d7224a6341e9dfed504f85e34d5fff35681ddb2b Mon Sep 17 00:00:00 2001 From: Y0hy0h Date: Thu, 1 Aug 2019 10:51:39 +0200 Subject: [PATCH 1/2] Improve documentation on implicit_hasher lint Provide an example of how to fix the lint. --- clippy_lints/src/types.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 1516428d3..adc37fdcc 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -1923,12 +1923,21 @@ declare_clippy_lint! { /// **Example:** /// ```rust /// # use std::collections::HashMap; - /// # use std::hash::Hash; + /// # use std::hash::{Hash, BuildHasher}; /// # trait Serialize {}; /// impl Serialize for HashMap { } /// /// pub fn foo(map: &mut HashMap) { } /// ``` + /// could be rewritten as + /// ```rust + /// # use std::collections::HashMap; + /// # use std::hash::Hash; + /// # trait Serialize {}; + /// impl Serialize for HashMap { } + /// + /// pub fn foo(map: &mut HashMap) { } + /// ``` pub IMPLICIT_HASHER, style, "missing generalization over different hashers" From 5decadd93eb806d34034344363828dce6fc3bd7a Mon Sep 17 00:00:00 2001 From: Y0hy0h Date: Thu, 1 Aug 2019 17:54:22 +0200 Subject: [PATCH 2/2] Fix missing import --- clippy_lints/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index adc37fdcc..6a7e449a2 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -1932,7 +1932,7 @@ declare_clippy_lint! { /// could be rewritten as /// ```rust /// # use std::collections::HashMap; - /// # use std::hash::Hash; + /// # use std::hash::{Hash, BuildHasher}; /// # trait Serialize {}; /// impl Serialize for HashMap { } ///