Improve error message if clock id isn't supported
@@ -45,7 +45,7 @@ fn time(clk_id: libc::clockid_t) -> Duration {
unsafe {
let mut timespec = mem::zeroed();
if libc::clock_gettime(clk_id, &mut timespec) != 0 {
- Err(Error::last_os_error()).unwrap()
+ Err(Error::last_os_error()).expect(&format!("Error creating clock with clk_id {}", clk_id);
}
Duration::new(timespec.tv_sec as u64, timespec.tv_nsec as u32)
}
