to_timespec could be unused by some targets

This commit is contained in:
Sébastien Marie 2022-05-11 04:51:09 +00:00
parent 3cadc11d83
commit 42f8e1f879

View File

@ -125,6 +125,7 @@ impl Timespec {
Some(Timespec::new(secs, nsec as i64))
}
#[allow(dead_code)]
pub fn to_timespec(&self) -> Option<libc::timespec> {
Some(libc::timespec {
tv_sec: self.tv_sec.try_into().ok()?,