Skip to content

Fixed same_name_method description #8061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clippy_lints/src/same_name_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::collections::{BTreeMap, BTreeSet};

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?
Expand Down Expand Up @@ -100,7 +100,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
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,
Expand Down Expand Up @@ -139,7 +139,7 @@ impl<'tcx> LateLintPass<'tcx> for SameNameMethod {
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?
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/same_name_method.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: method's name is same to an existing method in a trait
error: method's name is the same as an existing method in a trait
--> $DIR/same_name_method.rs:20:13
|
LL | fn foo() {}
Expand All @@ -11,7 +11,7 @@ note: existing `foo` defined here
LL | fn foo() {}
| ^^^^^^^^^^^

error: method's name is same to an existing method in a trait
error: method's name is the same as an existing method in a trait
--> $DIR/same_name_method.rs:44:13
|
LL | fn foo() {}
Expand All @@ -23,7 +23,7 @@ note: existing `foo` defined here
LL | fn foo() {}
| ^^^^^^^^^^^

error: method's name is same to an existing method in a trait
error: method's name is the same as an existing method in a trait
--> $DIR/same_name_method.rs:58:13
|
LL | fn foo() {}
Expand All @@ -35,7 +35,7 @@ note: existing `foo` defined here
LL | impl T1 for S {}
| ^^^^^^^^^^^^^^^^

error: method's name is same to an existing method in a trait
error: method's name is the same as an existing method in a trait
--> $DIR/same_name_method.rs:70:13
|
LL | fn foo() {}
Expand All @@ -47,7 +47,7 @@ note: existing `foo` defined here
LL | impl T1 for S {}
| ^^^^^^^^^^^^^^^^

error: method's name is same to an existing method in a trait
error: method's name is the same as an existing method in a trait
--> $DIR/same_name_method.rs:34:13
|
LL | fn clone() {}
Expand Down