pub fn earliest(times: &[SystemTime]) -> Option<SystemTime>Expand description
Find the earliest time in a collection.
If the collection is empty, returns None.
§Arguments
times- A slice ofSystemTimeitems.
§Returns
Option<SystemTime>- The earliestSystemTime, orNoneif the collection is empty.
§Examples
use std::time::{SystemTime, Duration};
use lowdash::earliest;
let t1 = SystemTime::UNIX_EPOCH;
let t2 = t1 + Duration::new(60, 0);
let t3 = t1 + Duration::new(120, 0);
let times = vec![t2, t1, t3];
let earliest_time = earliest(×);
assert_eq!(earliest_time, Some(t1));