From 9e6572fa282a18fecfb31a2c35c17c0e8c23e371 Mon Sep 17 00:00:00 2001 From: pennae Date: Mon, 25 Jul 2022 02:26:35 +0200 Subject: remove dependency on chrono prompted by a cargo audit run. time works just as well and is better maintained. web-push still uses chrono, but from the looks of things it won't be affected. --- tests/integration.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/integration.rs b/tests/integration.rs index 1866702..99c7a4f 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -2,7 +2,6 @@ use std::env; use anyhow::Context; use base64::URL_SAFE_NO_PAD; -use chrono::{Duration, Utc}; use futures::channel::oneshot::channel; use minor_skulk::{build, db::Db}; use password_hash::rand_core::OsRng; @@ -11,6 +10,7 @@ use rocket::{ fairing::AdHoc, tokio::{process::Command, spawn}, }; +use time::{Duration, OffsetDateTime}; #[macro_use] extern crate rocket; @@ -54,7 +54,9 @@ async fn run_pytest( let mut code = [0; 32]; OsRng.fill_bytes(&mut code); let code = base64::encode_config(code, URL_SAFE_NO_PAD); - tx.add_invite_code(&code, Utc::now() + Duration::minutes(5)).await.unwrap(); + tx.add_invite_code(&code, OffsetDateTime::now_utc() + Duration::minutes(5)) + .await + .unwrap(); tx.commit().await.unwrap(); env::set_var("INVITE_CODE", code); } -- cgit v1.2.3