Fixed more lint findings.
This commit is contained in:
parent
1c86b3758d
commit
0a43dcfd04
2 changed files with 4 additions and 5 deletions
|
@ -123,9 +123,7 @@ impl<'a> Conversion<'a> {
|
|||
|
||||
/// Checks if the to-type is the same (if there is a type constraint)
|
||||
fn has_compatible_to_type(&self, other: &Self) -> bool {
|
||||
transpose(self.to_type.as_ref(), other.to_type.as_ref())
|
||||
.map(|(l, r)| l == r)
|
||||
.unwrap_or(true)
|
||||
transpose(self.to_type.as_ref(), other.to_type.as_ref()).map_or(true, |(l, r)| l == r)
|
||||
}
|
||||
|
||||
/// Try to construct a new conversion if the conversion type is valid
|
||||
|
@ -149,7 +147,7 @@ impl<'a> Conversion<'a> {
|
|||
|
||||
impl ConversionType {
|
||||
/// Creates a conversion type if the type is allowed & conversion is valid
|
||||
fn try_new(from: &str, to: &str) -> Option<ConversionType> {
|
||||
fn try_new(from: &str, to: &str) -> Option<Self> {
|
||||
if UNSIGNED_TYPES.contains(&from) {
|
||||
Some(ConversionType::FromUnsigned)
|
||||
} else if SIGNED_TYPES.contains(&from) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue