diff --git a/Cargo.lock b/Cargo.lock index 4fd7293..3ce6b3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,9 +561,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jpeg-decoder" @@ -692,9 +692,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f" +checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", @@ -832,9 +832,9 @@ checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "openssl" -version = "0.10.31" +version = "0.10.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d008f51b1acffa0d3450a68606e6a51c123012edaacb0f4e1426bd978869187" +checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -852,9 +852,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.59" +version = "0.9.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de52d8eabd217311538a39bba130d7dea1f1e118010fee7a033d966845e7d5fe" +checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" dependencies = [ "autocfg", "cc", @@ -1290,9 +1290,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "itoa", "ryu", @@ -1323,9 +1323,9 @@ checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" [[package]] name = "socket2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e0e9fd577458a4f61fb91fcb559ea2afecc54c934119421f9f5d3d5b1a1057" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ "cfg-if 1.0.0", "libc", @@ -1340,9 +1340,9 @@ checksum = "a3ff2f71c82567c565ba4b3009a9350a96a7269eaa4001ebedae926230bc2254" [[package]] name = "syn" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a571a711dddd09019ccc628e1b17fe87c59b09d513c06c026877aa708334f37a" +checksum = "a9802ddde94170d186eeee5005b798d9c159fa970403f1be19976d0cfb939b72" dependencies = [ "proc-macro2", "quote", @@ -1676,7 +1676,6 @@ dependencies = [ "rusttype", "serde", "thiserror", - "time", "tokio", "tokio-stream", "toml", diff --git a/Cargo.toml b/Cargo.toml index f64ec61..f6647fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,8 +22,6 @@ futures = '0.3.8' tracing = '0.1.22' tracing-futures = '0.2.4' humantime = '2.0.1' -chrono = '0.4.19' -time = '0.1' img_hash = '3.1.0' # https://docs.rs/tokio/1.0.1/tokio/stream/index.html#why-was-stream-not-included-in-tokio-10 tokio-stream = '0.1.0' @@ -43,3 +41,8 @@ features = ['time', 'fs', 'sync', 'io-util', 'rt-multi-thread'] [dependencies.serde] version = '1.0.118' features = ['derive'] + +[dependencies.chrono] +version = '0.4.19' +default-features = false +features = [] diff --git a/src/lib.rs b/src/lib.rs index 67409e8..cfc8fe2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,6 @@ use std::path::Path; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; use thiserror::Error; -use time::Duration as OldDuration; use tokio_stream::StreamExt; use tokio::sync::watch; use tokio::sync::watch::{Receiver, Sender}; @@ -207,7 +206,7 @@ impl Server { match image_data.last_success { Some(last_success) => { Local::now().signed_duration_since(last_success) - > OldDuration::from_std(IMAGE_STALE_THRESHOLD).unwrap() + > chrono::Duration::from_std(IMAGE_STALE_THRESHOLD).unwrap() } _ => true, },