diff options
author | pennae <github@quasiparticle.net> | 2022-07-25 02:26:35 +0200 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2022-07-25 02:45:55 +0200 |
commit | 9e6572fa282a18fecfb31a2c35c17c0e8c23e371 (patch) | |
tree | c4ead0f54601fe010e2e17b0a8b43f6362b1c1a4 /tests | |
parent | 9aacaaf079373f8bc25f0533d7f6218e691c5de7 (diff) | |
download | minor-skulk-9e6572fa282a18fecfb31a2c35c17c0e8c23e371.tar.gz minor-skulk-9e6572fa282a18fecfb31a2c35c17c0e8c23e371.tar.xz minor-skulk-9e6572fa282a18fecfb31a2c35c17c0e8c23e371.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |