@@ -21,8 +21,7 @@ use super::Timeshift;
21
21
/// - and [GnssAbsoluteTime::outdate_weekly] to discard [TimePolynomial]s published before that week
22
22
#[ derive( Default , Clone ) ]
23
23
pub struct GnssAbsoluteTime {
24
- /// Internal [TimePolynomial]s
25
- polynomials : Vec < TimePolynomial > ,
24
+ pub polynomials : Vec < TimePolynomial > ,
26
25
}
27
26
28
27
impl GnssAbsoluteTime {
@@ -34,13 +33,13 @@ impl GnssAbsoluteTime {
34
33
}
35
34
36
35
/// Discard [TimePolynomial]s that were published prior "now".
37
- /// You must have latched newer [TimePolynomial]s with [Self::add_polynomial] for the structure to remain valid.
36
+ /// You must have latched newer [TimePolynomial]s for the structure to remain valid.
38
37
pub fn outdate_past ( & mut self , now : Epoch ) {
39
38
self . polynomials . retain ( |poly| poly. ref_epoch > now) ;
40
39
}
41
40
42
41
/// Discard [TimePolynomial]s that were published during past week from "now".
43
- /// You must have latched newer [TimePolynomial]s with [Self::add_polynomial] for the structure to remain valid.
42
+ /// You must have latched newer [TimePolynomial]s for the structure to remain valid.
44
43
pub fn outdate_weekly ( & mut self , now : Epoch ) {
45
44
let new_week = now. to_time_of_week ( ) . 0 ;
46
45
self . polynomials . retain ( |poly| {
@@ -49,12 +48,6 @@ impl GnssAbsoluteTime {
49
48
} ) ;
50
49
}
51
50
52
- /// Add a new [TimePolynomial] to this management pool.
53
- /// Usually right after its publication.
54
- pub fn add_polynomial ( & mut self , polynomial : TimePolynomial ) {
55
- self . polynomials . push ( polynomial) ;
56
- }
57
-
58
51
/// [Epoch] interpolation & correction attempt, into desired [TimeScale].
59
52
pub fn precise_epoch_correction ( & self , t : Epoch , target : TimeScale ) -> Option < Epoch > {
60
53
if t. time_scale == target {
@@ -245,7 +238,7 @@ impl Merge for GnssAbsoluteTime {
245
238
fn merge_mut ( & mut self , rhs : & Self ) -> Result < ( ) , MergeError > {
246
239
// latch new polynomials
247
240
for polynomial in rhs. polynomials . iter ( ) {
248
- self . add_polynomial ( * polynomial) ;
241
+ self . polynomials . push ( * polynomial) ;
249
242
}
250
243
Ok ( ( ) )
251
244
}
0 commit comments