]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/same_name_method.rs
modify code
[rust.git] / clippy_lints / src / same_name_method.rs
index 3f38d12fb557ffa167d3ed09168e09424c8e6649..22b458969551272c8083bf6cf97559055947c65c 100644 (file)
@@ -11,7 +11,7 @@
 
 declare_clippy_lint! {
     /// ### What it does
-    /// It lints if a struct has two method with same time:
+    /// It lints if a struct has two methods with the same name:
     /// one from a trait, another not from trait.
     ///
     /// ### Why is this bad?
@@ -87,7 +87,7 @@ fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
                                         .filter(|assoc_item| {
                                             matches!(assoc_item.kind, AssocKind::Fn)
                                         })
-                                        .map(|assoc_item| assoc_item.ident.name)
+                                        .map(|assoc_item| assoc_item.name)
                                         .collect()
                                 }else{
                                     BTreeSet::new()
@@ -100,7 +100,7 @@ fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
                                         cx,
                                         SAME_NAME_METHOD,
                                         *impl_span,
-                                        "method's name is same to an existing method in a trait",
+                                        "method's name is the same as an existing method in a trait",
                                         |diag| {
                                             diag.span_note(
                                                 trait_method_span,
@@ -139,7 +139,7 @@ fn check_crate_post(&mut self, cx: &LateContext<'tcx>) {
                                         cx,
                                         SAME_NAME_METHOD,
                                         impl_span,
-                                        "method's name is same to an existing method in a trait",
+                                        "method's name is the same as an existing method in a trait",
                                         |diag| {
                                             // TODO should we `span_note` on every trait?
                                             // iterate on trait_spans?