Fix false positive for wrong_self_convention

This commit is contained in:
Devon Hollowood 2016-10-27 01:11:34 -07:00
parent 49c2c2c628
commit 3a0d342a33
2 changed files with 7 additions and 1 deletions

View file

@ -1256,7 +1256,7 @@ impl Convention {
fn check(&self, other: &str) -> bool {
match *self {
Convention::Eq(this) => this == other,
Convention::StartsWith(this) => other.starts_with(this),
Convention::StartsWith(this) => other.starts_with(this) && this != other,
}
}
}

View file

@ -45,4 +45,10 @@ impl Bar {
pub fn to_i64(self) {} //~ERROR: methods called `to_*` usually take self by reference
pub fn from_i64(self) {} //~ERROR: methods called `from_*` usually take no self
// test for false positives
fn as_(self) {}
fn into_(&self) {}
fn is_(self) {}
fn to_(self) {}
fn from_(self) {}
}