From bceb00832e62322e48d37f331bd55212bfc40f67 Mon Sep 17 00:00:00 2001 From: David Quintanel Date: Fri, 11 Mar 2022 09:25:42 +0100 Subject: [PATCH] clippy --- src/ntfs/read.rs | 2 +- src/ntfs/write.rs | 2 +- src/objects.rs | 2 +- src/serde_utils.rs | 4 ++-- src/vptranslator.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ntfs/read.rs b/src/ntfs/read.rs index 3695fd8aa..1863cf8e0 100644 --- a/src/ntfs/read.rs +++ b/src/ntfs/read.rs @@ -295,7 +295,7 @@ where |v| v != 0, ); - let precision = stop_time.precision.or_else(|| { + let precision = stop_time.precision.or({ if datetime_estimated { Some(StopTimePrecision::Estimated) } else { diff --git a/src/ntfs/write.rs b/src/ntfs/write.rs index d5afc6eaf..f41972176 100644 --- a/src/ntfs/write.rs +++ b/src/ntfs/write.rs @@ -267,7 +267,7 @@ fn build_price_v1(id: &str, ticket: &Ticket, price: &TicketPrice) -> Result 59 || seconds > 59 { return Err(TimeError::WrongValue); diff --git a/src/serde_utils.rs b/src/serde_utils.rs index 4ced15ce3..7bbbb6934 100644 --- a/src/serde_utils.rs +++ b/src/serde_utils.rs @@ -130,7 +130,7 @@ where { use serde::Deserialize; let option = Option::::deserialize(de)?; - Ok(option.map(|s| s.replace("/", ""))) + Ok(option.map(|s| s.replace('/', ""))) } /// deserialize type @@ -267,7 +267,7 @@ where use serde::ser::Error; let currency_code = iso4217::alpha3(currency_code) .ok_or_else(|| S::Error::custom("The String is not a valid currency code (ISO-4217)"))?; - serializer.serialize_str(¤cy_code.alpha3.to_string()) + serializer.serialize_str(currency_code.alpha3) } /// serialize geometry to wkt diff --git a/src/vptranslator.rs b/src/vptranslator.rs index 57e11ed58..05138f5eb 100644 --- a/src/vptranslator.rs +++ b/src/vptranslator.rs @@ -324,7 +324,7 @@ mod tests { fn empty_vp() { let res = translate(&get_dates_from_bitset( Date::from_ymd(2012, 7, 16), - &"0000000".to_string(), + "0000000", )); assert_eq!(0b000_0000, get_week_from_weekday(res.operating_days));