[−][src]Crate tarde
TARDE (tar-dee, Time And Rust Duration Ergonomics
A simple wrapper to '{integer}' types that improves ergonomics around std::time::Duration
Example:
use std::time::{Instant, Duration}; use std::thread; use tarde::*; // Before: fn std_way() { let x: u64 = 10; let now = Instant::now(); thread::sleep(Duration::from_millis(2569)); assert!(now.elapsed() >= Duration::from_millis(x)); } // After: fn main() -> Result<(), Error> { let x = 10; let now = Instant::now(); thread::sleep(x.millis()?); Ok(assert!(now.elapsed() >= x.millis()?)) }
Enums
Error | Using |
Traits
During |
|