Skip to content

Commit a40ae73

Browse files
authored
Auto merge of #453 - xfix:remove-time-dependency, r=jdm
Remove time dependency time 0.1 has known security issues, and it's not really necessary to use time crate anymore for getting precise instants as std::time::Instant::now [has the same implementation as precise_time_ns on popular platforms](https://stackoverflow.com/a/55619763).
2 parents f9636f9 + b2b8030 commit a40ae73

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

xml5ever/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ categories = [ "parser-implementations", "web-programming" ]
1616
edition = "2018"
1717

1818
[dependencies]
19-
time = "0.1"
2019
log = "0.4"
2120
mac = "0.1"
2221
markup5ever = {version = "0.10", path = "../markup5ever" }

xml5ever/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub use markup5ever::*;
3636

3737
macro_rules! time {
3838
($e:expr) => {{
39-
let t0 = ::time::precise_time_ns();
39+
let t0 = ::std::time::Instant::now();
4040
let result = $e;
41-
let dt = ::time::precise_time_ns() - t0;
41+
let dt = t0.elapsed().as_nanos() as u64;
4242
(result, dt)
4343
}};
4444
}

0 commit comments

Comments
 (0)