rename .from to .since

main
Bel LaPointe 2023-11-27 08:44:39 -07:00
parent 3f83364f8f
commit 673f511e3d
1 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ mod test_save_load {
} }
impl TSheet { impl TSheet {
fn from(&self, t: SystemTime) -> TSheet { fn since(&self, t: SystemTime) -> TSheet {
let mut result = TSheet{xs: vec![]}; let mut result = TSheet{xs: vec![]};
self.xs.iter() self.xs.iter()
.filter(|x| x.ts() >= t) .filter(|x| x.ts() >= t)
@ -101,7 +101,7 @@ mod test_tsheet {
use super::*; use super::*;
#[test] #[test]
fn test_tsheet_from_date() { fn test_tsheet_since_date() {
let given = TSheet{xs: vec![ let given = TSheet{xs: vec![
X{t: 1, x: "def".to_string(), tag: "abc".to_string()}, X{t: 1, x: "def".to_string(), tag: "abc".to_string()},
X{t: 2, x: "ghi".to_string(), tag: "".to_string()}, X{t: 2, x: "ghi".to_string(), tag: "".to_string()},
@ -111,7 +111,7 @@ mod test_tsheet {
X{t: 2, x: "ghi".to_string(), tag: "".to_string()}, X{t: 2, x: "ghi".to_string(), tag: "".to_string()},
X{t: 3, x: "jkl".to_string(), tag: "".to_string()}, X{t: 3, x: "jkl".to_string(), tag: "".to_string()},
]}; ]};
let got = given.from(UNIX_EPOCH.add(Duration::from_secs(2))); let got = given.since(UNIX_EPOCH.add(Duration::from_secs(2)));
assert_eq!(got, want); assert_eq!(got, want);
} }
} }