@@ -46,7 +46,7 @@ use winnow::{
46
46
use super :: {
47
47
epoch:: sec_and_nsec,
48
48
primitive:: { colon, ctx_err, dec_uint, s} ,
49
- timezone:: { timezone_num , Offset } ,
49
+ timezone:: { timezone_offset , Offset } ,
50
50
} ;
51
51
52
52
#[ derive( PartialEq , Clone , Debug , Default ) ]
@@ -55,7 +55,7 @@ pub(crate) struct Time {
55
55
pub ( crate ) minute : u8 ,
56
56
pub ( crate ) second : u8 ,
57
57
pub ( crate ) nanosecond : u32 ,
58
- pub ( crate ) offset : Option < Offset > ,
58
+ pub ( super ) offset : Option < Offset > ,
59
59
}
60
60
61
61
impl TryFrom < Time > for jiff:: civil:: Time {
@@ -87,7 +87,7 @@ pub(crate) fn parse(input: &mut &str) -> ModalResult<Time> {
87
87
/// Also used by the [`combined`](super::combined) module
88
88
pub ( super ) fn iso ( input : & mut & str ) -> ModalResult < Time > {
89
89
alt ( (
90
- ( hour24, timezone_num ) . map ( |( hour, offset) | Time {
90
+ ( hour24, timezone_offset ) . map ( |( hour, offset) | Time {
91
91
hour,
92
92
minute : 0 ,
93
93
second : 0 ,
@@ -99,7 +99,7 @@ pub(super) fn iso(input: &mut &str) -> ModalResult<Time> {
99
99
colon,
100
100
minute,
101
101
opt ( preceded ( colon, second) ) ,
102
- opt ( timezone_num ) ,
102
+ opt ( timezone_offset ) ,
103
103
)
104
104
. map ( |( hour, _, minute, sec_nsec, offset) | Time {
105
105
hour,
@@ -337,11 +337,7 @@ mod tests {
337
337
minute : 23 ,
338
338
second : 0 ,
339
339
nanosecond : 0 ,
340
- offset : Some ( Offset {
341
- negative : false ,
342
- hours : 5 ,
343
- minutes : 0 ,
344
- } ) ,
340
+ offset : Some ( ( false , 5 , 0 ) . try_into ( ) . unwrap ( ) ) ,
345
341
} ;
346
342
347
343
for mut s in [
@@ -368,11 +364,7 @@ mod tests {
368
364
minute : 45 ,
369
365
second : 0 ,
370
366
nanosecond : 0 ,
371
- offset : Some ( Offset {
372
- negative : false ,
373
- hours : 5 ,
374
- minutes : 35 ,
375
- } ) ,
367
+ offset : Some ( ( false , 5 , 35 ) . try_into ( ) . unwrap ( ) ) ,
376
368
} ;
377
369
378
370
for mut s in [
@@ -401,11 +393,7 @@ mod tests {
401
393
minute : 45 ,
402
394
second : 0 ,
403
395
nanosecond : 0 ,
404
- offset : Some ( Offset {
405
- negative : false ,
406
- hours : 0 ,
407
- minutes : 35 ,
408
- } ) ,
396
+ offset : Some ( ( false , 0 , 35 ) . try_into ( ) . unwrap ( ) ) ,
409
397
} ;
410
398
411
399
for mut s in [
@@ -433,11 +421,7 @@ mod tests {
433
421
minute : 45 ,
434
422
second : 0 ,
435
423
nanosecond : 0 ,
436
- offset : Some ( Offset {
437
- negative : true ,
438
- hours : 5 ,
439
- minutes : 35 ,
440
- } ) ,
424
+ offset : Some ( ( true , 5 , 35 ) . try_into ( ) . unwrap ( ) ) ,
441
425
} ;
442
426
443
427
for mut s in [
0 commit comments