@@ -3,7 +3,7 @@ use crate::{
3
3
processing:: TimePolynomial ,
4
4
} ;
5
5
6
- use hifitime:: { Epoch , TimeScale } ;
6
+ use hifitime:: { Epoch , TimeScale , Unit } ;
7
7
8
8
#[ cfg( doc) ]
9
9
use super :: Timeshift ;
@@ -32,20 +32,17 @@ impl GnssAbsoluteTime {
32
32
}
33
33
}
34
34
35
- /// Discard [TimePolynomial]s that were published prior "now".
35
+ /// Discard [TimePolynomial]s that were published prior proposed instant.
36
36
/// You must have latched newer [TimePolynomial]s for the structure to remain valid.
37
- pub fn outdate_past ( & mut self , now : Epoch ) {
38
- self . polynomials . retain ( |poly| poly. ref_epoch > now ) ;
37
+ pub fn outdate_past ( & mut self , instant : Epoch ) {
38
+ self . polynomials . retain ( |poly| poly. ref_epoch > instant ) ;
39
39
}
40
40
41
- /// Discard [TimePolynomial]s that were published during past week from "now".
41
+ /// Discard [TimePolynomial]s that were published 7 days prior the proposed instant.
42
42
/// You must have latched newer [TimePolynomial]s for the structure to remain valid.
43
- pub fn outdate_weekly ( & mut self , now : Epoch ) {
44
- let new_week = now. to_time_of_week ( ) . 0 ;
45
- self . polynomials . retain ( |poly| {
46
- let tow = poly. ref_epoch . to_time_of_week ( ) . 0 ;
47
- tow >= new_week
48
- } ) ;
43
+ pub fn outdate_weekly ( & mut self , instant : Epoch ) {
44
+ let limit = instant - 7.0 * Unit :: Week ;
45
+ self . polynomials . retain ( |poly| poly. ref_epoch > limit) ;
49
46
}
50
47
51
48
/// [Epoch] interpolation & correction attempt, into desired [TimeScale].
0 commit comments