rename .from to .since
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user