From d6bcd6a0f38459ccadaef6f5830026ac9c466263 Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sun, 12 Mar 2017 21:50:39 +0000 Subject: [PATCH] Replace time with std::time --- Cargo.toml | 1 - tests/test_round_trip.rs | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1b50a559d1..7f57dcf1b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,5 +27,4 @@ synom = { version = "0.11", path = "synom", optional = true } syntex_pos = "0.58" syntex_syntax = "0.58" tempdir = "0.3.5" -time = "0.1.35" walkdir = "1.0.1" diff --git a/tests/test_round_trip.rs b/tests/test_round_trip.rs index b07730d947..c1a785e7fc 100644 --- a/tests/test_round_trip.rs +++ b/tests/test_round_trip.rs @@ -5,18 +5,17 @@ extern crate quote; extern crate syn; extern crate syntex_pos; extern crate syntex_syntax; -extern crate time; extern crate walkdir; use syntex_pos::Span; use syntex_syntax::ast; use syntex_syntax::parse::{self, ParseSess, PResult}; -use time::PreciseTime; use walkdir::{DirEntry, WalkDir, WalkDirIterator}; use std::fs::File; use std::io::{self, Read, Write}; use std::panic; +use std::time::Instant; macro_rules! errorf { ($($tt:tt)*) => { @@ -75,9 +74,9 @@ fn test_round_trip() { let mut content = String::new(); file.read_to_string(&mut content).unwrap(); - let start = PreciseTime::now(); + let start = Instant::now(); let (krate, elapsed) = match syn::parse_crate(&content) { - Ok(krate) => (krate, start.to(PreciseTime::now())), + Ok(krate) => (krate, start.elapsed()), Err(msg) => { errorf!("syn failed to parse\n{}\n", msg); failed += 1; @@ -111,7 +110,7 @@ fn test_round_trip() { }; if before == after { - errorf!("pass in {}ms\n", elapsed.num_milliseconds()); + errorf!("pass in {}ms\n", (elapsed.as_secs() * 1000) as u64 + elapsed.subsec_nanos() / 1000_000); true } else { errorf!("FAIL\nbefore: {}\nafter: {}\n",