Closed FrankReh closed 1 year ago
I'm assuming you would know that the compiler will optimize the TimeSpec sequence of calls
types::Timespec::new().sec(dur.as_secs()).nsec(dur.subsec_nanos())
because I myself am not sure. So I don't think my From
impl's actually add any value. I realize there is no reason to convert back from a TimeSpec to a Duration. So I'm going to close this. Thanks for considering it though.
Like the nix crate does:
On Linux, the std::time::Duration and __kernel_timespec should be trivially interchangeable.
This implements the std::convert::From trait in each direction.