@@ -102,6 +102,7 @@ impl TimeDelta {
102102 /// Panics when the duration is out of bounds.
103103 #[ inline]
104104 #[ must_use]
105+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_weeks` instead" ) ]
105106 pub const fn weeks ( weeks : i64 ) -> TimeDelta {
106107 expect ! ( TimeDelta :: try_weeks( weeks) , "TimeDelta::weeks out of bounds" )
107108 }
@@ -129,6 +130,7 @@ impl TimeDelta {
129130 /// Panics when the `TimeDelta` would be out of bounds.
130131 #[ inline]
131132 #[ must_use]
133+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_days` instead" ) ]
132134 pub const fn days ( days : i64 ) -> TimeDelta {
133135 expect ! ( TimeDelta :: try_days( days) , "TimeDelta::days out of bounds" )
134136 }
@@ -155,6 +157,7 @@ impl TimeDelta {
155157 /// Panics when the `TimeDelta` would be out of bounds.
156158 #[ inline]
157159 #[ must_use]
160+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_hours` instead" ) ]
158161 pub const fn hours ( hours : i64 ) -> TimeDelta {
159162 expect ! ( TimeDelta :: try_hours( hours) , "TimeDelta::hours out of bounds" )
160163 }
@@ -180,6 +183,7 @@ impl TimeDelta {
180183 /// Panics when the `TimeDelta` would be out of bounds.
181184 #[ inline]
182185 #[ must_use]
186+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_minutes` instead" ) ]
183187 pub const fn minutes ( minutes : i64 ) -> TimeDelta {
184188 expect ! ( TimeDelta :: try_minutes( minutes) , "TimeDelta::minutes out of bounds" )
185189 }
@@ -204,6 +208,7 @@ impl TimeDelta {
204208 /// (in this context, this is the same as `i64::MIN / 1_000` due to rounding).
205209 #[ inline]
206210 #[ must_use]
211+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_seconds` instead" ) ]
207212 pub const fn seconds ( seconds : i64 ) -> TimeDelta {
208213 expect ! ( TimeDelta :: try_seconds( seconds) , "TimeDelta::seconds out of bounds" )
209214 }
@@ -227,7 +232,7 @@ impl TimeDelta {
227232 /// Panics when the `TimeDelta` would be out of bounds, i.e. when `milliseconds` is more than
228233 /// `i64::MAX` or less than `-i64::MAX`. Notably, this is not the same as `i64::MIN`.
229234 #[ inline]
230- #[ deprecated]
235+ #[ deprecated( since = "0.4.35" , note = "Use `TimeDelta::try_milliseconds` instead" ) ]
231236 pub const fn milliseconds ( milliseconds : i64 ) -> TimeDelta {
232237 expect ! ( TimeDelta :: try_milliseconds( milliseconds) , "TimeDelta::milliseconds out of bounds" )
233238 }
@@ -683,6 +688,7 @@ mod tests {
683688 }
684689
685690 #[ test]
691+ #[ allow( deprecated) ]
686692 #[ should_panic( expected = "TimeDelta::seconds out of bounds" ) ]
687693 fn test_duration_seconds_max_overflow_panic ( ) {
688694 let _ = TimeDelta :: seconds ( i64:: MAX / 1_000 + 1 ) ;
@@ -704,6 +710,7 @@ mod tests {
704710 }
705711
706712 #[ test]
713+ #[ allow( deprecated) ]
707714 #[ should_panic( expected = "TimeDelta::seconds out of bounds" ) ]
708715 fn test_duration_seconds_min_underflow_panic ( ) {
709716 let _ = TimeDelta :: seconds ( -i64:: MAX / 1_000 - 1 ) ;
@@ -766,6 +773,7 @@ mod tests {
766773 }
767774
768775 #[ test]
776+ #[ allow( deprecated) ]
769777 #[ should_panic( expected = "TimeDelta::milliseconds out of bounds" ) ]
770778 fn test_duration_milliseconds_min_underflow_panic ( ) {
771779 // Here we ensure that trying to create a value one millisecond below the
0 commit comments