mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
time: impl From between std / tokio Instants (#1904)
This commit is contained in:
committed by
Carl Lerche
parent
b7ecd35036
commit
c3461b3ef3
@@ -126,6 +126,18 @@ impl Instant {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::time::Instant> for Instant {
|
||||
fn from(time: std::time::Instant) -> Instant {
|
||||
Instant::from_std(time)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Instant> for std::time::Instant {
|
||||
fn from(time: Instant) -> std::time::Instant {
|
||||
time.into_std()
|
||||
}
|
||||
}
|
||||
|
||||
impl ops::Add<Duration> for Instant {
|
||||
type Output = Instant;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user