From d7224a6341e9dfed504f85e34d5fff35681ddb2b Mon Sep 17 00:00:00 2001 From: Y0hy0h Date: Thu, 1 Aug 2019 10:51:39 +0200 Subject: [PATCH] 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 1516428d3fd..adc37fdcc97 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -1923,12 +1923,21 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { /// **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" -- 2.44.0