File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ macro_rules! invalid_component {
26
26
}
27
27
28
28
#[ test]
29
+ #[ allow( clippy:: cognitive_complexity) ]
29
30
fn rfc_2822 ( ) -> time:: Result < ( ) > {
30
31
assert_eq ! (
31
32
OffsetDateTime :: parse( "Sat, 02 Jan 2021 03:04:05 GMT" , & Rfc2822 ) ?,
@@ -664,6 +665,7 @@ fn iso_8601() {
664
665
}
665
666
666
667
#[ test]
668
+ #[ allow( clippy:: cognitive_complexity) ]
667
669
fn iso_8601_error ( ) {
668
670
assert ! ( matches!(
669
671
OffsetDateTime :: parse( "20210102T03:04Z" , & Iso8601 :: DEFAULT ) ,
Original file line number Diff line number Diff line change 2
2
3
3
#[ cfg( feature = "formatting" ) ]
4
4
use alloc:: string:: String ;
5
- use core:: num:: { NonZero , NonZeroI32 } ;
5
+ use core:: num:: { NonZeroI32 , NonZeroU8 } ;
6
6
use core:: ops:: { Add , Sub } ;
7
7
use core:: time:: Duration as StdDuration ;
8
8
use core:: { cmp, fmt} ;
@@ -335,7 +335,7 @@ impl Date {
335
335
let month = ( ( ordinal - day_adj) * 10 + 300 ) / 306 + month_adj;
336
336
// Safety: `month` is guaranteed to be between 1 and 12 inclusive.
337
337
unsafe {
338
- match Month :: from_number ( NonZero :: new_unchecked ( month as u8 ) ) {
338
+ match Month :: from_number ( NonZeroU8 :: new_unchecked ( month as u8 ) ) {
339
339
Ok ( month) => month,
340
340
Err ( _) => core:: hint:: unreachable_unchecked ( ) ,
341
341
}
@@ -452,7 +452,7 @@ impl Date {
452
452
year,
453
453
// Safety: `month` is guaranteed to be between 1 and 12 inclusive.
454
454
unsafe {
455
- match Month :: from_number ( NonZero :: new_unchecked ( month as u8 ) ) {
455
+ match Month :: from_number ( NonZeroU8 :: new_unchecked ( month as u8 ) ) {
456
456
Ok ( month) => month,
457
457
Err ( _) => core:: hint:: unreachable_unchecked ( ) ,
458
458
}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ mod parse_from_description;
17
17
#[ cfg( feature = "parsing" ) ]
18
18
mod try_from_parsed;
19
19
20
+ #[ cfg( feature = "parsing" ) ]
20
21
use core:: convert:: Infallible ;
21
22
use core:: fmt;
22
23
You can’t perform that action at this time.
0 commit comments