From 12ea985cce074eb3723127fae2fa78aadc852f77 Mon Sep 17 00:00:00 2001 From: Gerd Zellweger Date: Thu, 14 Dec 2023 14:40:01 -0800 Subject: [PATCH] Fix two CI lint errors reported by clippy. Signed-off-by: Gerd Zellweger --- src/datetime/tests.rs | 2 +- src/format/scan.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datetime/tests.rs b/src/datetime/tests.rs index a2808f63d9..cd3b4bf3cb 100644 --- a/src/datetime/tests.rs +++ b/src/datetime/tests.rs @@ -403,7 +403,7 @@ fn signed_duration_since_autoref() { let dt1 = Utc.with_ymd_and_hms(2014, 5, 6, 7, 8, 9).unwrap(); let dt2 = Utc.with_ymd_and_hms(2014, 3, 4, 5, 6, 7).unwrap(); let diff1 = dt1.signed_duration_since(dt2); // Copy/consume - let diff2 = dt2.signed_duration_since(&dt1); // Take by reference + let diff2 = dt2.signed_duration_since(dt1); // Take by reference assert_eq!(diff1, -diff2); let diff1 = dt1 - &dt2; // We can choose to substract rhs by reference diff --git a/src/format/scan.rs b/src/format/scan.rs index d8b896c840..6eafc2efbc 100644 --- a/src/format/scan.rs +++ b/src/format/scan.rs @@ -306,7 +306,7 @@ where }; s = match s.len() { len if len >= 2 => &s[2..], - len if len == 0 => s, + 0 => s, _ => return Err(TOO_SHORT), };