mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-30 22:01:07 +00:00
Updated formatting
This commit is contained in:
parent
24a4379832
commit
2f58d1968a
@ -162,7 +162,6 @@ impl<'s, 'a, M: RawMutex, T: Clone, const N: usize> Rcv<'a, M, T, N> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Wait for a change to the value of the corresponding `MultiSignal` which matches the predicate `f`.
|
/// Wait for a change to the value of the corresponding `MultiSignal` which matches the predicate `f`.
|
||||||
// TODO: How do we make this work with a FnMut closure?
|
|
||||||
pub async fn changed_and<F>(&mut self, f: F) -> T
|
pub async fn changed_and<F>(&mut self, f: F) -> T
|
||||||
where
|
where
|
||||||
F: FnMut(&T) -> bool,
|
F: FnMut(&T) -> bool,
|
||||||
@ -286,8 +285,13 @@ pub struct ReceiverPredFuture<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&'a T) ->
|
|||||||
predicate: F,
|
predicate: F,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&T) -> bool, const N: usize> Unpin for ReceiverPredFuture<'s, 'a, M, T, F, N> {}
|
impl<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&T) -> bool, const N: usize> Unpin
|
||||||
impl<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&T) -> bool, const N: usize> Future for ReceiverPredFuture<'s, 'a, M, T, F, N>{
|
for ReceiverPredFuture<'s, 'a, M, T, F, N>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
impl<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&T) -> bool, const N: usize> Future
|
||||||
|
for ReceiverPredFuture<'s, 'a, M, T, F, N>
|
||||||
|
{
|
||||||
type Output = T;
|
type Output = T;
|
||||||
|
|
||||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||||
@ -318,9 +322,10 @@ impl<'s, 'a, M: RawMutex, T: Clone, F: FnMut(&T) -> bool, const N: usize> Receiv
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use futures_executor::block_on;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::blocking_mutex::raw::CriticalSectionRawMutex;
|
use crate::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||||
use futures_executor::block_on;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn multiple_writes() {
|
fn multiple_writes() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user