From 1c86b3758d5ee0ee0b151d4f4b0dcc06c70ed1ae Mon Sep 17 00:00:00 2001 From: pJunger Date: Sun, 12 May 2019 21:14:44 +0200 Subject: [PATCH] Fixed clippy lints in checked_conversions.rs. --- clippy_lints/src/checked_conversions.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clippy_lints/src/checked_conversions.rs b/clippy_lints/src/checked_conversions.rs index 55a496f1fce6..0269a1959b76 100644 --- a/clippy_lints/src/checked_conversions.rs +++ b/clippy_lints/src/checked_conversions.rs @@ -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 rustc::hir::*; @@ -61,7 +61,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CheckedConversions { item.span, &format!( "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 { INT_TYPES - .into_iter() + .iter() .find(|c| (&ty.ident.name) == *c) .cloned() } else {