mirror of
https://gitee.com/openharmony/third_party_rust_humantime
synced 2024-11-23 07:30:19 +00:00
Migrate to 2018 edition
Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
parent
f569740ed2
commit
897b7f6dc9
@ -9,6 +9,7 @@ keywords = ["time", "human", "human-friendly", "parser", "duration"]
|
||||
homepage = "https://github.com/tailhook/humantime"
|
||||
documentation = "https://docs.rs/humantime"
|
||||
version = "1.3.0"
|
||||
edition = "2018"
|
||||
authors = ["Paul Colomiets <paul@colomiets.name>"]
|
||||
categories = ["date-and-time"]
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
#![feature(test)]
|
||||
extern crate chrono;
|
||||
extern crate humantime;
|
||||
extern crate test;
|
||||
|
||||
use std::io::Write;
|
||||
use std::time::{Duration, UNIX_EPOCH};
|
||||
use humantime::format_rfc3339;
|
||||
|
||||
use humantime::format_rfc3339;
|
||||
|
||||
#[bench]
|
||||
fn rfc3339_humantime_seconds(b: &mut test::Bencher) {
|
||||
|
@ -1,12 +1,9 @@
|
||||
#![feature(test)]
|
||||
extern crate chrono;
|
||||
extern crate humantime;
|
||||
extern crate test;
|
||||
|
||||
use chrono::{DateTime};
|
||||
use humantime::parse_rfc3339;
|
||||
|
||||
|
||||
#[bench]
|
||||
fn rfc3339_humantime_seconds(b: &mut test::Bencher) {
|
||||
b.iter(|| {
|
||||
|
@ -364,12 +364,11 @@ impl fmt::Display for Rfc3339Timestamp {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern crate time;
|
||||
extern crate rand;
|
||||
|
||||
use std::str::from_utf8;
|
||||
use self::rand::Rng;
|
||||
use std::time::{UNIX_EPOCH, SystemTime, Duration};
|
||||
|
||||
use rand::Rng;
|
||||
|
||||
use super::{parse_rfc3339, parse_rfc3339_weak, format_rfc3339};
|
||||
use super::{format_rfc3339_millis, format_rfc3339_micros};
|
||||
use super::{format_rfc3339_nanos};
|
||||
|
@ -301,10 +301,10 @@ impl fmt::Display for FormattedDuration {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern crate rand;
|
||||
|
||||
use std::time::Duration;
|
||||
use self::rand::Rng;
|
||||
|
||||
use rand::Rng;
|
||||
|
||||
use super::{parse_duration, format_duration};
|
||||
use super::Error;
|
||||
|
||||
|
@ -3,8 +3,8 @@ use std::ops::Deref;
|
||||
use std::fmt;
|
||||
use std::time::{Duration as StdDuration, SystemTime};
|
||||
|
||||
use duration::{self, parse_duration, format_duration};
|
||||
use date::{self, parse_rfc3339_weak, format_rfc3339};
|
||||
use crate::duration::{self, parse_duration, format_duration};
|
||||
use crate::date::{self, parse_rfc3339_weak, format_rfc3339};
|
||||
|
||||
/// A wrapper for duration that has `FromStr` implementation
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user