Skip to content

Commit

Permalink
Add const fn Events::new() (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
ia0 authored Jun 15, 2023
1 parent b25946a commit fdc6832
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/scheduler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions crates/scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ mod stores;
pub struct Events<B: Board>(VecDeque<board::Event<B>>);

impl<B: Board> Events<B> {
pub const fn new() -> Self {
Self(VecDeque::new())
}

pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
Expand Down

0 comments on commit fdc6832

Please sign in to comment.