use regular UnixTimestamp ctor
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-02-05 20:27:50 +01:00
parent 8cf6f72cf3
commit 16bd0f0956
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -223,10 +223,10 @@ pub trait CcsdsTimeProvider {
fn unix_seconds(&self) -> i64;
fn subsecond_millis(&self) -> Option<u16>;
fn unix_stamp(&self) -> UnixTimestamp {
UnixTimestamp {
unix_seconds: self.unix_seconds(),
subsecond_millis: self.subsecond_millis(),
if self.subsecond_millis().is_none() {
return UnixTimestamp::new_only_seconds(self.unix_seconds());
}
UnixTimestamp::const_new(self.unix_seconds(), self.subsecond_millis().unwrap())
}
fn date_time(&self) -> Option<DateTime<Utc>>;