Skip to content

Commit

Permalink
Remove dependency to obsolete time
Browse files Browse the repository at this point in the history
Signed-off-by: Sami Salonen <ssalonen@iki.fi>
  • Loading branch information
Sami Salonen committed Dec 30, 2020
1 parent 43a6480 commit f1f30c7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
29 changes: 14 additions & 15 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 = []
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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,
},
Expand Down

0 comments on commit f1f30c7

Please sign in to comment.