summaryrefslogtreecommitdiff
path: root/src/test/fixtures/filter.rs
blob: c31fa5805981c9fc813c313f88a8acb8b3110490 (plain)
1
2
3
4
5
6
7
8
9
10
11
use futures::future;

use crate::events::types;

pub fn messages() -> impl FnMut(&types::ChannelEvent) -> future::Ready<bool> {
    |event| future::ready(matches!(event.data, types::ChannelEventData::Message(_)))
}

pub fn created() -> impl FnMut(&types::ChannelEvent) -> future::Ready<bool> {
    |event| future::ready(matches!(event.data, types::ChannelEventData::Created(_)))
}