Merge pull request #1301 from devonhollowood/wrong-self-convention-fix

Fix false positive for `wrong_self_convention`
This commit is contained in:
Martin Carton 2016-10-27 10:38:15 +02:00 committed by GitHub
commit 502416fa78
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) {}
}