Skip to content

Commit

Permalink
build(deps): Bump chrono from 0.4.26 to 0.4.30 and remove use of depr…
Browse files Browse the repository at this point in the history
…ecated function (0.5 backport) (#1918)

* build(deps): Bump chrono from 0.4.26 to 0.4.30

Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.26 to 0.4.30.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](chronotope/chrono@v0.4.26...v0.4.30)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove deprecated use of DateTime::from_utc

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
inahga and dependabot[bot] authored Sep 12, 2023
1 parent 3d3a3fa commit 73a5018
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 49 deletions.
30 changes: 6 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 14 additions & 25 deletions collector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]

use backoff::{backoff::Backoff, ExponentialBackoff};
use chrono::{DateTime, Duration, Utc};
use chrono::{DateTime, Duration, TimeZone, Utc};
use derivative::Derivative;
use http_api_problem::HttpApiProblem;
pub use janus_core::task::AuthenticationToken;
Expand Down Expand Up @@ -551,10 +551,7 @@ impl<V: vdaf::Collector> Collector<V> {
partial_batch_selector: collect_response.partial_batch_selector().clone(),
report_count: collect_response.report_count(),
interval: (
DateTime::<Utc>::from_utc(
collect_response.interval().start().as_naive_date_time()?,
Utc,
),
Utc.from_utc_datetime(&collect_response.interval().start().as_naive_date_time()?),
collect_response
.interval()
.duration()
Expand Down Expand Up @@ -664,7 +661,7 @@ mod tests {
PollResult,
};
use assert_matches::assert_matches;
use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
use chrono::{NaiveDateTime, TimeZone, Utc};
#[cfg(feature = "fpvec_bounded_l2")]
use fixed_macro::fixed;
use janus_core::{
Expand Down Expand Up @@ -915,9 +912,8 @@ mod tests {
PartialBatchSelector::new_time_interval(),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
Utc
Utc.from_utc_datetime(
&NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
),
chrono::Duration::seconds(3600),
),
Expand Down Expand Up @@ -984,9 +980,8 @@ mod tests {
PartialBatchSelector::new_time_interval(),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
Utc
Utc.from_utc_datetime(
&NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
),
chrono::Duration::seconds(3600),
),
Expand Down Expand Up @@ -1052,9 +1047,8 @@ mod tests {
PartialBatchSelector::new_time_interval(),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
Utc
Utc.from_utc_datetime(
&NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
),
chrono::Duration::seconds(3600),
),
Expand Down Expand Up @@ -1129,9 +1123,8 @@ mod tests {
PartialBatchSelector::new_time_interval(),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
Utc
Utc.from_utc_datetime(
&NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
),
chrono::Duration::seconds(3600),
),
Expand Down Expand Up @@ -1199,10 +1192,7 @@ mod tests {
PartialBatchSelector::new_fixed_size(batch_id),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),
Utc
),
Utc.from_utc_datetime(&NaiveDateTime::from_timestamp_opt(0, 0).unwrap()),
chrono::Duration::seconds(1),
),
1
Expand Down Expand Up @@ -1280,9 +1270,8 @@ mod tests {
PartialBatchSelector::new_time_interval(),
1,
(
DateTime::<Utc>::from_utc(
NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
Utc
Utc.from_utc_datetime(
&NaiveDateTime::from_timestamp_opt(1_000_000, 0).unwrap(),
),
chrono::Duration::seconds(3600),
),
Expand Down

0 comments on commit 73a5018

Please sign in to comment.