Fixed clippy lints in checked_conversions.rs.
This commit is contained in:
parent
14d948c560
commit
1c86b3758d
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
//! lint on manually implemented checked conversions that could be transformed into try_from
|
//! lint on manually implemented checked conversions that could be transformed into `try_from`
|
||||||
|
|
||||||
use if_chain::if_chain;
|
use if_chain::if_chain;
|
||||||
use rustc::hir::*;
|
use rustc::hir::*;
|
||||||
|
@ -61,7 +61,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CheckedConversions {
|
||||||
item.span,
|
item.span,
|
||||||
&format!(
|
&format!(
|
||||||
"Checked cast can be simplified: `{}::try_from`",
|
"Checked cast can be simplified: `{}::try_from`",
|
||||||
cv.to_type.unwrap_or("IntegerType".to_string()),
|
cv.to_type.unwrap_or_else(|| "IntegerType".to_string()),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ fn int_ty_to_str(path: &QPath) -> Option<&str> {
|
||||||
|
|
||||||
then {
|
then {
|
||||||
INT_TYPES
|
INT_TYPES
|
||||||
.into_iter()
|
.iter()
|
||||||
.find(|c| (&ty.ident.name) == *c)
|
.find(|c| (&ty.ident.name) == *c)
|
||||||
.cloned()
|
.cloned()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue