@@ -46,7 +46,7 @@ use winnow::{
4646use super :: {
4747 epoch:: sec_and_nsec,
4848 primitive:: { colon, ctx_err, dec_uint, s} ,
49- timezone:: { timezone_num , Offset } ,
49+ timezone:: { timezone_offset , Offset } ,
5050} ;
5151
5252#[ derive( PartialEq , Clone , Debug , Default ) ]
@@ -55,7 +55,7 @@ pub(crate) struct Time {
5555 pub ( crate ) minute : u8 ,
5656 pub ( crate ) second : u8 ,
5757 pub ( crate ) nanosecond : u32 ,
58- pub ( crate ) offset : Option < Offset > ,
58+ pub ( super ) offset : Option < Offset > ,
5959}
6060
6161impl TryFrom < Time > for jiff:: civil:: Time {
@@ -87,7 +87,7 @@ pub(crate) fn parse(input: &mut &str) -> ModalResult<Time> {
8787/// Also used by the [`combined`](super::combined) module
8888pub ( super ) fn iso ( input : & mut & str ) -> ModalResult < Time > {
8989 alt ( (
90- ( hour24, timezone_num ) . map ( |( hour, offset) | Time {
90+ ( hour24, timezone_offset ) . map ( |( hour, offset) | Time {
9191 hour,
9292 minute : 0 ,
9393 second : 0 ,
@@ -99,7 +99,7 @@ pub(super) fn iso(input: &mut &str) -> ModalResult<Time> {
9999 colon,
100100 minute,
101101 opt ( preceded ( colon, second) ) ,
102- opt ( timezone_num ) ,
102+ opt ( timezone_offset ) ,
103103 )
104104 . map ( |( hour, _, minute, sec_nsec, offset) | Time {
105105 hour,
@@ -337,11 +337,7 @@ mod tests {
337337 minute : 23 ,
338338 second : 0 ,
339339 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 ( ) ) ,
345341 } ;
346342
347343 for mut s in [
@@ -368,11 +364,7 @@ mod tests {
368364 minute : 45 ,
369365 second : 0 ,
370366 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 ( ) ) ,
376368 } ;
377369
378370 for mut s in [
@@ -401,11 +393,7 @@ mod tests {
401393 minute : 45 ,
402394 second : 0 ,
403395 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 ( ) ) ,
409397 } ;
410398
411399 for mut s in [
@@ -433,11 +421,7 @@ mod tests {
433421 minute : 45 ,
434422 second : 0 ,
435423 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 ( ) ) ,
441425 } ;
442426
443427 for mut s in [
0 commit comments