Skip to content

Commit

Permalink
update collections
Browse files Browse the repository at this point in the history
  • Loading branch information
enjhnsn2 committed Nov 16, 2024
1 parent e64bcd3 commit 793c017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kernel/src/collections/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ pub trait Queue<T> {

/// Remove and return one (the first) element that matches the predicate.
#[flux_rs::trusted_impl]
// #[flux_rs::sig(fn(self: &strg Self, _) -> Option<_> ensures self: Self)]
fn remove_first_matching<F>(&mut self, f: F) -> Option<T>
where
F: Fn(&T) -> bool;

/// Remove all elements from the ring buffer.
#[flux_rs::trusted_impl]
// #[flux_rs::sig(fn(self: &strg Self) ensures self: Self)]
fn empty(&mut self);

/// Retains only the elements that satisfy the predicate.
Expand Down
2 changes: 1 addition & 1 deletion kernel/src/collections/ring_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<T: Copy> queue::Queue<T> for RingBuffer<'_, T> {
///
/// If an element was removed, this function returns it as `Some(elem)`.
#[flux_rs::sig(
fn(self: &strg RingBuffer<T>, _) -> Option<T> ensures self: RingBuffer<T>
fn(self: &strg Self, _) -> Option<_> ensures self: Self
)]
fn remove_first_matching<F>(&mut self, f: F) -> Option<T>
where
Expand Down

0 comments on commit 793c017

Please sign in to comment.