common: Remove more unnecessary bounds
This commit is contained in:
parent
8f1eae97ce
commit
510b8485d8
@ -103,10 +103,7 @@ impl Ruleset {
|
|||||||
&self,
|
&self,
|
||||||
event: &Raw<T>,
|
event: &Raw<T>,
|
||||||
context: &PushConditionRoomCtx,
|
context: &PushConditionRoomCtx,
|
||||||
) -> Option<AnyPushRuleRef<'_>>
|
) -> Option<AnyPushRuleRef<'_>> {
|
||||||
where
|
|
||||||
T: Serialize,
|
|
||||||
{
|
|
||||||
let event = FlattenedJson::from_raw(event);
|
let event = FlattenedJson::from_raw(event);
|
||||||
self.iter().find(|rule| rule.applies(&event, context))
|
self.iter().find(|rule| rule.applies(&event, context))
|
||||||
}
|
}
|
||||||
@ -119,10 +116,7 @@ impl Ruleset {
|
|||||||
///
|
///
|
||||||
/// * `event` - The raw JSON of a room message event.
|
/// * `event` - The raw JSON of a room message event.
|
||||||
/// * `context` - The context of the message and room at the time of the event.
|
/// * `context` - The context of the message and room at the time of the event.
|
||||||
pub fn get_actions<T>(&self, event: &Raw<T>, context: &PushConditionRoomCtx) -> &[Action]
|
pub fn get_actions<T>(&self, event: &Raw<T>, context: &PushConditionRoomCtx) -> &[Action] {
|
||||||
where
|
|
||||||
T: Serialize,
|
|
||||||
{
|
|
||||||
self.get_match(event, context).map(|rule| rule.actions()).unwrap_or(&[])
|
self.get_match(event, context).map(|rule| rule.actions()).unwrap_or(&[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user