Migrate to 2018 edition

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
koushiro 2020-01-17 20:28:09 +08:00
parent f569740ed2
commit 897b7f6dc9
6 changed files with 10 additions and 15 deletions

View File

@ -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"]

View File

@ -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) {

View File

@ -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(|| {

View File

@ -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};

View File

@ -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;

View File

@ -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
///