deps: update chrono to 0.4

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Gnatenko
2018-07-25 22:44:32 +02:00
parent 35fc95b066
commit e634d3f139
6 changed files with 17 additions and 17 deletions

View File

@@ -7,7 +7,7 @@ use hyper::header::ContentType;
use url::form_urlencoded;
use itertools::Itertools;
use serde_json as json;
use chrono::{self, UTC};
use chrono::{self, Utc};
use std::borrow::BorrowMut;
use std::io::Read;
use std::i64;
@@ -133,7 +133,7 @@ impl<C> DeviceFlow<C>
let pi = PollInformation {
user_code: decoded.user_code,
verification_url: decoded.verification_url,
expires_at: UTC::now() + chrono::Duration::seconds(decoded.expires_in),
expires_at: Utc::now() + chrono::Duration::seconds(decoded.expires_in),
interval: Duration::from_secs(i64::abs(decoded.interval) as u64),
};
self.state = Some(DeviceFlowState::Pending(pi.clone()));
@@ -175,7 +175,7 @@ impl<C> DeviceFlow<C>
_ => panic!("You have to call request_code() beforehand"),
};
if pi.expires_at <= UTC::now() {
if pi.expires_at <= Utc::now() {
self.error = Some(PollError::Expired(pi.expires_at));
self.state = Some(DeviceFlowState::Error);
return Err(&self.error.as_ref().unwrap());