Stop relying on features activated through dev-dependencies
This commit is contained in:
parent
1c47963bef
commit
8de0776796
@ -17,7 +17,6 @@ mod kw {
|
|||||||
/// Parses attributes for `*EventContent` derives.
|
/// Parses attributes for `*EventContent` derives.
|
||||||
///
|
///
|
||||||
/// `#[ruma_event(type = "m.room.alias")]`
|
/// `#[ruma_event(type = "m.room.alias")]`
|
||||||
#[derive(Eq, PartialEq)]
|
|
||||||
enum EventMeta {
|
enum EventMeta {
|
||||||
/// Variant holds the "m.whatever" event type.
|
/// Variant holds the "m.whatever" event type.
|
||||||
Type(LitStr),
|
Type(LitStr),
|
||||||
@ -60,7 +59,7 @@ struct MetaAttrs(Vec<EventMeta>);
|
|||||||
|
|
||||||
impl MetaAttrs {
|
impl MetaAttrs {
|
||||||
fn is_custom(&self) -> bool {
|
fn is_custom(&self) -> bool {
|
||||||
self.0.iter().any(|a| a == &EventMeta::CustomRedacted)
|
self.0.iter().any(|a| matches!(a, &EventMeta::CustomRedacted))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_event_type(&self) -> Option<&LitStr> {
|
fn get_event_type(&self) -> Option<&LitStr> {
|
||||||
@ -127,8 +126,10 @@ pub fn expand_event_content(
|
|||||||
let mut fields = named
|
let mut fields = named
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|f| {
|
.filter(|f| {
|
||||||
f.attrs.iter().find_map(|a| a.parse_args::<EventMeta>().ok())
|
matches!(
|
||||||
== Some(EventMeta::SkipRedacted)
|
f.attrs.iter().find_map(|a| a.parse_args::<EventMeta>().ok()),
|
||||||
|
Some(EventMeta::SkipRedacted)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user