From 6aba097b1074cf038964522437e4ba6528689bec Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 18 Aug 2020 13:01:43 +0200 Subject: [PATCH] Fix search::search_events event types --- ruma-client-api/CHANGELOG.md | 1 + ruma-client-api/src/r0/search/search_events.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ruma-client-api/CHANGELOG.md b/ruma-client-api/CHANGELOG.md index c1b13444..2719e533 100644 --- a/ruma-client-api/CHANGELOG.md +++ b/ruma-client-api/CHANGELOG.md @@ -58,6 +58,7 @@ Breaking changes: the `ruma-common` crate * Replace `r0::room::create_room::InitialStateEvent` with `ruma_events::InitialStateEvent` * `error::ErrorKind` no longer implements `Copy`, `FromStr` +* Switch from `AnyEvent` to `AnyRoomEvent` in `r0::search::search_events` Improvements: diff --git a/ruma-client-api/src/r0/search/search_events.rs b/ruma-client-api/src/r0/search/search_events.rs index c6e1ff12..aa86b0e0 100644 --- a/ruma-client-api/src/r0/search/search_events.rs +++ b/ruma-client-api/src/r0/search/search_events.rs @@ -5,7 +5,7 @@ use std::collections::BTreeMap; use js_int::{uint, UInt}; use ruma_api::{ruma_api, Outgoing}; use ruma_common::Raw; -use ruma_events::{AnyEvent, AnyStateEvent}; +use ruma_events::{AnyRoomEvent, AnyStateEvent}; use ruma_identifiers::{EventId, RoomId, UserId}; use serde::{Deserialize, Serialize}; @@ -186,11 +186,11 @@ pub struct EventContextResult { /// Events just after the result. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub events_after: Vec>, + pub events_after: Vec>, /// Events just before the result. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub events_before: Vec>, + pub events_before: Vec>, /// The historic profile information of the users that sent the events returned. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] @@ -411,7 +411,7 @@ pub struct SearchResult { /// The event that matched. #[serde(skip_serializing_if = "Option::is_none")] - pub result: Option>, + pub result: Option>, } impl SearchResult {