Update to remove use of deprecated method (#3468)

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Co-authored-by: Russell Cohen <rcoh@amazon.com>
This commit is contained in:
John DiSanti 2024-03-06 12:03:39 -08:00 committed by GitHub
parent fceb914fb2
commit 1f4d2b9e54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "aws-smithy-types-convert"
version = "0.60.7"
version = "0.60.8"
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
description = "Conversion of types from aws-smithy-types to other libraries."
edition = "2021"
@ -14,8 +14,8 @@ convert-streams = ["aws-smithy-async", "futures-core"]
[dependencies]
aws-smithy-types = { path = "../aws-smithy-types", optional = true }
aws-smithy-async = {path = "../aws-smithy-async", optional = true}
chrono = { version = "0.4.26", optional = true, default-features = false, features = ["std"] }
aws-smithy-async = { path = "../aws-smithy-async", optional = true }
chrono = { version = "0.4.35", optional = true, default-features = false, features = ["std"] }
time = { version = "0.3.4", optional = true }
futures-core = { version = "0.3.0", optional = true }

View File

@ -130,13 +130,13 @@ pub trait DateTimeExt {
impl DateTimeExt for DateTime {
#[cfg(feature = "convert-chrono")]
fn to_chrono_utc(&self) -> Result<chrono::DateTime<chrono::Utc>, Error> {
match chrono::NaiveDateTime::from_timestamp_opt(self.secs(), self.subsec_nanos()) {
match chrono::DateTime::from_timestamp(self.secs(), self.subsec_nanos()) {
None => Err(Error::out_of_range(format!(
"out-of-range seconds {} or invalid nanoseconds {}",
self.secs(),
self.subsec_nanos()
))),
Some(dt) => Ok(chrono::TimeZone::from_utc_datetime(&chrono::Utc, &dt)),
Some(dt) => Ok(dt),
}
}