1
Fork 0

Update all the code to pass the updated use_self lint.

One struct required a temporary `#[allow(dead_code)]` annotation due to
a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.
This commit is contained in:
Jakub Wieczorek 2019-07-31 00:25:35 +00:00
parent 41110b0039
commit 2a13e83f2b
10 changed files with 80 additions and 79 deletions

View file

@ -160,12 +160,12 @@ impl ConversionType {
/// Creates a conversion type if the type is allowed & conversion is valid
fn try_new(from: &str, to: &str) -> Option<Self> {
if UINTS.contains(&from) {
Some(ConversionType::FromUnsigned)
Some(Self::FromUnsigned)
} else if SINTS.contains(&from) {
if UINTS.contains(&to) {
Some(ConversionType::SignedToUnsigned)
Some(Self::SignedToUnsigned)
} else if SINTS.contains(&to) {
Some(ConversionType::SignedToSigned)
Some(Self::SignedToSigned)
} else {
None
}