11#[ cfg( feature = "chrono" ) ]
22mod chrono_support;
3+ #[ cfg( feature = "jiff" ) ]
4+ mod jiff_support;
35#[ cfg( feature = "time" ) ]
46mod time_support;
57
6- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
8+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
79use super :: constants:: * ;
810use super :: { DateTimeDiff , DateTimeParts } ;
911
10- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
12+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
1113#[ derive( Debug , Clone , Copy ) ]
1214struct AddedDateTimeParts {
1315 year : i32 ,
@@ -19,7 +21,7 @@ struct AddedDateTimeParts {
1921 nanosecond : u32 ,
2022}
2123
22- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
24+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
2325#[ inline]
2426fn month_add ( year : & mut i32 , month : & mut i32 , n : i32 ) -> Option < ( ) > {
2527 * month = month. checked_add ( n) ?;
@@ -40,7 +42,7 @@ fn month_add(year: &mut i32, month: &mut i32, n: i32) -> Option<()> {
4042 Some ( ( ) )
4143}
4244
43- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
45+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
4446#[ inline]
4547fn date_add ( year : & mut i32 , month : & mut i32 , date : & mut i32 , n : i32 ) -> Option < ( ) > {
4648 * date = date. checked_add ( n) ?;
@@ -81,7 +83,7 @@ fn date_add(year: &mut i32, month: &mut i32, date: &mut i32, n: i32) -> Option<(
8183 Some ( ( ) )
8284}
8385
84- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
86+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
8587#[ inline]
8688fn hour_add ( year : & mut i32 , month : & mut i32 , date : & mut i32 , hour : & mut i32 , n : i32 ) -> Option < ( ) > {
8789 * hour = hour. checked_add ( n) ?;
@@ -102,7 +104,7 @@ fn hour_add(year: &mut i32, month: &mut i32, date: &mut i32, hour: &mut i32, n:
102104 Some ( ( ) )
103105}
104106
105- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
107+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
106108#[ inline]
107109fn minute_add (
108110 year : & mut i32 ,
@@ -130,7 +132,7 @@ fn minute_add(
130132 Some ( ( ) )
131133}
132134
133- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
135+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
134136#[ inline]
135137fn second_add (
136138 year : & mut i32 ,
@@ -159,7 +161,7 @@ fn second_add(
159161 Some ( ( ) )
160162}
161163
162- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
164+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
163165#[ allow( clippy:: too_many_arguments) ]
164166#[ inline]
165167fn nanosecond_add (
@@ -187,7 +189,7 @@ fn nanosecond_add(
187189 Some ( ( ) )
188190}
189191
190- #[ cfg( any( feature = "chrono" , feature = "time" ) ) ]
192+ #[ cfg( any( feature = "chrono" , feature = "jiff" , feature = " time") ) ]
191193fn add_date_time_parts (
192194 from : & impl DateTimeParts ,
193195 date_time_diff : & impl DateTimeDiff ,
0 commit comments