update use

This commit is contained in:
2020-04-12 01:19:44 +08:00
parent f1ede0bca7
commit b7c747c565
5 changed files with 24 additions and 57 deletions

View File

@@ -1,15 +1,13 @@
use std::{
fs::File,
time::SystemTime,
};
use std::fs::File;
use sha1::Sha1;
use hmac::{
Hmac,
Mac,
};
use hmac::{ Hmac, Mac, };
use reqwest::Response;
use rust_util::*;
use rust_util::{
iff,
XResult,
new_box_ioerror,
util_time::get_current_secs,
};
pub const DEFAULT_URL_VALID_IN_SECS: u64 = 1000;
@@ -136,8 +134,3 @@ fn calc_hmac_sha1(key: &[u8], message: &[u8]) -> String {
Err(e) => format!("[ERROR]Hmac error: {}", e),
}
}
fn get_current_secs() -> u64 {
SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs()
}