From 3b7b49b4dacc15c6934cceecf85f71600dc1a383 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Sun, 29 Jan 2023 18:01:18 +0800 Subject: [PATCH] ticktimer: use sleep_heap.pop_first() This function was stabilized in Rust 1.66.0. Signed-off-by: Sean Cross --- services/xous-ticktimer/src/main.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/services/xous-ticktimer/src/main.rs b/services/xous-ticktimer/src/main.rs index bf3631278..f4542e3ee 100644 --- a/services/xous-ticktimer/src/main.rs +++ b/services/xous-ticktimer/src/main.rs @@ -465,11 +465,7 @@ fn start_sleep( sleep_heap: &mut BTreeMap, // min-heap with Reverse ) { // If there are items in the sleep heap, take the next item that will expire. - // TODO: Replace this with `.min()` when it's stabilized: - // https://github.com/rust-lang/rust/issues/62924 - let next_timeout_msec = sleep_heap.iter().min().map(|(msec, _)| *msec); - if let Some(msec) = next_timeout_msec { - let next_response = sleep_heap.remove(&msec).unwrap(); + if let Some((_msec, next_response)) = sleep_heap.pop_first() { #[cfg(feature = "debug-print")] info!( "scheduling a response at {} to {} (heap: {:?})",