From 3315017b9bb33e77b6b25a408eb4c4ffce95ee29 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 24 Jan 2023 11:37:25 +0100 Subject: [PATCH] bugfix for scheduling file --- NOTICE | 2 +- satrs-core/src/pus/scheduling.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NOTICE b/NOTICE index ff0443b..2c878e5 100644 --- a/NOTICE +++ b/NOTICE @@ -1,3 +1,3 @@ Workspace for the satrs framework development. -This software contains code developed at the University of Stuttgart's Institute of Space Systems. \ No newline at end of file +This software contains code developed at the University of Stuttgart's Institute of Space Systems. diff --git a/satrs-core/src/pus/scheduling.rs b/satrs-core/src/pus/scheduling.rs index 98bb1bd..d996600 100644 --- a/satrs-core/src/pus/scheduling.rs +++ b/satrs-core/src/pus/scheduling.rs @@ -28,9 +28,9 @@ impl PusScheduler { pub fn num_scheduled_telecommands(&self) -> u64 { let mut num_entries = 0; for entries in &self.tc_map { - num_entries += entries.1.len(); + num_entries += entries.1.len() as u64; } - num_entries.into() + num_entries } pub fn is_enabled(&self) -> bool { @@ -63,8 +63,12 @@ impl PusScheduler { return false; } match self.tc_map.entry(time_stamp) { - Entry::Vacant(e) => e.insert(vec![addr]), - Entry::Occupied(mut v) => v.get_mut().push(addr), + Entry::Vacant(e) => { + e.insert(vec![addr]); + }, + Entry::Occupied(mut v) => { + v.get_mut().push(addr); + }, } true }