From fdc68328f7aa792d3912805b9fa4b85f62aa44c5 Mon Sep 17 00:00:00 2001 From: Julien Cretin Date: Thu, 15 Jun 2023 14:43:23 +0200 Subject: [PATCH] Add const fn Events::new() (#178) --- crates/scheduler/CHANGELOG.md | 1 + crates/scheduler/src/lib.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/crates/scheduler/CHANGELOG.md b/crates/scheduler/CHANGELOG.md index 5f51cb14..877b91ec 100644 --- a/crates/scheduler/CHANGELOG.md +++ b/crates/scheduler/CHANGELOG.md @@ -10,6 +10,7 @@ ### Minor +- Add `const fn Events::new()` for compile-time construction - Update `wasefire-applet-api` to 0.3.0 ## 0.1.2 diff --git a/crates/scheduler/src/lib.rs b/crates/scheduler/src/lib.rs index 1c8948b4..2d264899 100644 --- a/crates/scheduler/src/lib.rs +++ b/crates/scheduler/src/lib.rs @@ -45,6 +45,10 @@ mod stores; pub struct Events(VecDeque>); impl Events { + pub const fn new() -> Self { + Self(VecDeque::new()) + } + pub fn is_empty(&self) -> bool { self.0.is_empty() }