Skip to content

Commit c866c3c

Browse files
committed
Fix lints, CI failure
1 parent b9651fb commit c866c3c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/parsing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ macro_rules! invalid_component {
2626
}
2727

2828
#[test]
29+
#[allow(clippy::cognitive_complexity)]
2930
fn rfc_2822() -> time::Result<()> {
3031
assert_eq!(
3132
OffsetDateTime::parse("Sat, 02 Jan 2021 03:04:05 GMT", &Rfc2822)?,
@@ -664,6 +665,7 @@ fn iso_8601() {
664665
}
665666

666667
#[test]
668+
#[allow(clippy::cognitive_complexity)]
667669
fn iso_8601_error() {
668670
assert!(matches!(
669671
OffsetDateTime::parse("20210102T03:04Z", &Iso8601::DEFAULT),

time/src/date.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
#[cfg(feature = "formatting")]
44
use alloc::string::String;
5-
use core::num::{NonZero, NonZeroI32};
5+
use core::num::{NonZeroI32, NonZeroU8};
66
use core::ops::{Add, Sub};
77
use core::time::Duration as StdDuration;
88
use core::{cmp, fmt};
@@ -335,7 +335,7 @@ impl Date {
335335
let month = ((ordinal - day_adj) * 10 + 300) / 306 + month_adj;
336336
// Safety: `month` is guaranteed to be between 1 and 12 inclusive.
337337
unsafe {
338-
match Month::from_number(NonZero::new_unchecked(month as u8)) {
338+
match Month::from_number(NonZeroU8::new_unchecked(month as u8)) {
339339
Ok(month) => month,
340340
Err(_) => core::hint::unreachable_unchecked(),
341341
}
@@ -452,7 +452,7 @@ impl Date {
452452
year,
453453
// Safety: `month` is guaranteed to be between 1 and 12 inclusive.
454454
unsafe {
455-
match Month::from_number(NonZero::new_unchecked(month as u8)) {
455+
match Month::from_number(NonZeroU8::new_unchecked(month as u8)) {
456456
Ok(month) => month,
457457
Err(_) => core::hint::unreachable_unchecked(),
458458
}

time/src/error/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod parse_from_description;
1717
#[cfg(feature = "parsing")]
1818
mod try_from_parsed;
1919

20+
#[cfg(feature = "parsing")]
2021
use core::convert::Infallible;
2122
use core::fmt;
2223

0 commit comments

Comments
 (0)