diff --git a/rustv1/cross_service/photo_asset_management/src/handlers/download.rs b/rustv1/cross_service/photo_asset_management/src/handlers/download.rs index 6c97a8eb078..f66f820171e 100644 --- a/rustv1/cross_service/photo_asset_management/src/handlers/download.rs +++ b/rustv1/cross_service/photo_asset_management/src/handlers/download.rs @@ -84,7 +84,7 @@ async fn send_notification( .key(destination.1) .presigned( PresigningConfig::builder() - .expires_in(Duration::days(1).to_std()?) + .expires_in(Duration::try_days(1).unwrap().to_std()?) .build()?, ) .await?; diff --git a/rustv1/cross_service/photo_asset_management/tests/test_pipe.rs b/rustv1/cross_service/photo_asset_management/tests/test_pipe.rs index 06a55a80a21..e777102f16d 100644 --- a/rustv1/cross_service/photo_asset_management/tests/test_pipe.rs +++ b/rustv1/cross_service/photo_asset_management/tests/test_pipe.rs @@ -1,6 +1,6 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -use chrono::NaiveDateTime; +use chrono::DateTime; use std::io::Read; use streaming_zip::Archive; @@ -14,7 +14,7 @@ async fn main() -> Result<(), anyhow::Error> { let mut body = [0u8; READ_SIZE]; zip_writer.start_new_file( "name".into(), - NaiveDateTime::from_timestamp_micros(0).unwrap(), + DateTime::from_timestamp_micros(0).unwrap().naive_utc(), streaming_zip::CompressionMode::Deflate(8), false, )?;