diff --git a/Cargo.toml b/Cargo.toml index d93b7df8..b2f5e08c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,2 @@ [workspace] members = ["ruma", "ruma-*"] - -# Required until ruma-events becomes part of the workspace -[patch.crates-io] -ruma-common = { path = "ruma-common" } -ruma-identifiers = { path = "ruma-identifiers" } -ruma-serde = { path = "ruma-serde" } diff --git a/ruma-api/Cargo.toml b/ruma-api/Cargo.toml index 76492875..c16621d1 100644 --- a/ruma-api/Cargo.toml +++ b/ruma-api/Cargo.toml @@ -26,4 +26,4 @@ serde_json = "1.0.53" strum = "0.18.0" [dev-dependencies] -ruma-events = { git = "https://github.com/ruma/ruma-events", rev = "c1ee72d" } +ruma-events = { version = "0.21.3", path = "../ruma-events" } diff --git a/ruma-api/tests/ruma_api_macros.rs b/ruma-api/tests/ruma_api_macros.rs index b4bf6434..7898f143 100644 --- a/ruma-api/tests/ruma_api_macros.rs +++ b/ruma-api/tests/ruma_api_macros.rs @@ -1,6 +1,6 @@ pub mod some_endpoint { use ruma_api::ruma_api; - use ruma_events::{collections::all, tag::TagEvent, EventJson}; + use ruma_events::{tag::TagEvent, AnyRoomEvent, EventJson}; ruma_api! { metadata { @@ -46,7 +46,7 @@ pub mod some_endpoint { pub event: EventJson, // ... and to allow unknown events when the endpoint deals with event collections. - pub list_of_events: Vec>, + pub list_of_events: Vec>, } } } diff --git a/ruma-appservice-api/Cargo.toml b/ruma-appservice-api/Cargo.toml index ff7f1ee7..dd92cb5f 100644 --- a/ruma-appservice-api/Cargo.toml +++ b/ruma-appservice-api/Cargo.toml @@ -12,8 +12,8 @@ version = "0.1.0" edition = "2018" [dependencies] -ruma-api = "0.16.1" -ruma-events = { git = "https://github.com/ruma/ruma-events", rev = "c1ee72d" } +ruma-api = { version = "0.16.1", path = "../ruma-api" } +ruma-events = { version = "0.21.3", path = "../ruma-events" } ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers" } serde = { version = "1.0.111", features = ["derive"] } serde_json = "1.0.52" diff --git a/ruma-appservice-api/src/v1/event/push_events.rs b/ruma-appservice-api/src/v1/event/push_events.rs index bef1ec46..6f165ca5 100644 --- a/ruma-appservice-api/src/v1/event/push_events.rs +++ b/ruma-appservice-api/src/v1/event/push_events.rs @@ -1,7 +1,7 @@ //! [PUT /_matrix/app/v1/transactions/{txnId}](https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid) use ruma_api::ruma_api; -use ruma_events::{collections::all, EventJson}; +use ruma_events::{AnyEvent, EventJson}; ruma_api! { metadata { @@ -21,7 +21,7 @@ ruma_api! { pub txn_id: String, /// A list of events. #[ruma_api(body)] - pub events: Vec>, + pub events: Vec>, } response {} diff --git a/ruma-client-api/Cargo.toml b/ruma-client-api/Cargo.toml index 20d0ce59..2d69d685 100644 --- a/ruma-client-api/Cargo.toml +++ b/ruma-client-api/Cargo.toml @@ -21,7 +21,7 @@ http = "0.2.1" js_int = { version = "0.1.5", features = ["serde"] } ruma-api = { version = "0.16.1", path = "../ruma-api" } ruma-common = { version = "0.1.3", path = "../ruma-common" } -ruma-events = { git = "https://github.com/ruma/ruma-events", rev = "c1ee72d" } +ruma-events = { version = "0.21.3", path = "../ruma-events" } ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers" } ruma-serde = { version = "0.2.2", path = "../ruma-serde" } serde = { version = "1.0.111", features = ["derive"] } diff --git a/ruma-client-api/src/r0/config/get_global_account_data.rs b/ruma-client-api/src/r0/config/get_global_account_data.rs index d8c1d763..f61282ee 100644 --- a/ruma-client-api/src/r0/config/get_global_account_data.rs +++ b/ruma-client-api/src/r0/config/get_global_account_data.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-user-userid-account-data-type) use ruma_api::ruma_api; -use ruma_events::{collections::only, EventJson}; +use ruma_events::{AnyBasicEvent, EventJson}; use ruma_identifiers::UserId; ruma_api! { @@ -27,7 +27,7 @@ ruma_api! { response { /// Account data content for the given type. #[ruma_api(body)] - pub account_data: EventJson, + pub account_data: EventJson, } error: crate::Error diff --git a/ruma-client-api/src/r0/config/get_room_account_data.rs b/ruma-client-api/src/r0/config/get_room_account_data.rs index a2b39600..bda18c73 100644 --- a/ruma-client-api/src/r0/config/get_room_account_data.rs +++ b/ruma-client-api/src/r0/config/get_room_account_data.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/user/{userId}/rooms/{roomId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-user-userid-rooms-roomid-account-data-type) use ruma_api::ruma_api; -use ruma_events::{collections::only, EventJson}; +use ruma_events::{AnyBasicEvent, EventJson}; use ruma_identifiers::{RoomId, UserId}; ruma_api! { @@ -31,7 +31,7 @@ ruma_api! { response { /// Account data content for the given type. #[ruma_api(body)] - pub account_data: EventJson, + pub account_data: EventJson, } error: crate::Error diff --git a/ruma-client-api/src/r0/context/get_context.rs b/ruma-client-api/src/r0/context/get_context.rs index 14cdc610..ed23862f 100644 --- a/ruma-client-api/src/r0/context/get_context.rs +++ b/ruma-client-api/src/r0/context/get_context.rs @@ -2,7 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_events::{collections::all, EventJson}; +use ruma_events::{AnyRoomEvent, AnyStateEvent, EventJson}; use ruma_identifiers::{EventId, RoomId}; use crate::r0::filter::RoomEventFilter; @@ -55,20 +55,20 @@ ruma_api! { /// A list of room events that happened just before the requested event, /// in reverse-chronological order. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub events_before: Vec>, + pub events_before: Vec>, /// Details of the requested event. #[serde(skip_serializing_if = "Option::is_none")] - pub event: Option>, + pub event: Option>, /// A list of room events that happened just after the requested event, /// in chronological order. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub events_after: Vec>, + pub events_after: Vec>, /// The state of the room at the last event returned. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub state: Vec>, + pub state: Vec>, } error: crate::Error diff --git a/ruma-client-api/src/r0/message.rs b/ruma-client-api/src/r0/message.rs index 1bcdf5ae..65c9de5b 100644 --- a/ruma-client-api/src/r0/message.rs +++ b/ruma-client-api/src/r0/message.rs @@ -1,4 +1,4 @@ //! Enpoints for sending and receiving messages pub mod create_message_event; -pub mod get_message_events; +//pub mod get_message_events; diff --git a/ruma-client-api/src/r0/message/get_message_events.rs b/ruma-client-api/src/r0/message/get_message_events.rs index bf0adf03..59e0407a 100644 --- a/ruma-client-api/src/r0/message/get_message_events.rs +++ b/ruma-client-api/src/r0/message/get_message_events.rs @@ -2,10 +2,7 @@ use js_int::UInt; use ruma_api::ruma_api; -use ruma_events::{ - collections::all::{RoomEvent, StateEvent}, - EventJson, -}; +use ruma_events::{AnyRoomEvent, AnyStateEvent, EventJson}; use ruma_identifiers::RoomId; use serde::{Deserialize, Serialize}; @@ -75,11 +72,11 @@ ruma_api! { /// A list of room events. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub chunk: Vec>, + pub chunk: Vec>, /// A list of state events relevant to showing the `chunk`. #[serde(default, skip_serializing_if = "Vec::is_empty")] - pub state: Vec>, + pub state: Vec>, } error: crate::Error diff --git a/ruma-client-api/src/r0/push.rs b/ruma-client-api/src/r0/push.rs index e967b852..64391007 100644 --- a/ruma-client-api/src/r0/push.rs +++ b/ruma-client-api/src/r0/push.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use strum::{Display, EnumString}; pub mod delete_pushrule; -pub mod get_notifications; +//pub mod get_notifications; pub mod get_pushers; pub mod get_pushrule; pub mod get_pushrule_actions; diff --git a/ruma-client-api/src/r0/push/get_notifications.rs b/ruma-client-api/src/r0/push/get_notifications.rs index 43a946c3..f7e07b9d 100644 --- a/ruma-client-api/src/r0/push/get_notifications.rs +++ b/ruma-client-api/src/r0/push/get_notifications.rs @@ -4,7 +4,7 @@ use std::time::SystemTime; use js_int::UInt; use ruma_api::ruma_api; -use ruma_events::{collections::all, EventJson}; +use ruma_events::{AnyEvent, EventJson}; use ruma_identifiers::RoomId; use serde::{Deserialize, Serialize}; @@ -59,7 +59,7 @@ pub struct Notification { pub actions: Vec, /// The event that triggered the notification. - pub event: EventJson, + pub event: EventJson, /// The profile tag of the rule that matched this event. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/ruma-client-api/src/r0/room.rs b/ruma-client-api/src/r0/room.rs index 6c20c58b..cebb0416 100644 --- a/ruma-client-api/src/r0/room.rs +++ b/ruma-client-api/src/r0/room.rs @@ -1,7 +1,7 @@ //! Endpoints for room management. pub mod create_room; -pub mod get_room_event; +//pub mod get_room_event; pub mod report_content; pub mod upgrade_room; diff --git a/ruma-client-api/src/r0/room/get_room_event.rs b/ruma-client-api/src/r0/room/get_room_event.rs index fdf58126..9c5cd686 100644 --- a/ruma-client-api/src/r0/room/get_room_event.rs +++ b/ruma-client-api/src/r0/room/get_room_event.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/rooms/{roomId}/event/{eventId}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-rooms-roomid-event-eventid) use ruma_api::ruma_api; -use ruma_events::{collections::all, EventJson}; +use ruma_events::{AnyRoomEvent, EventJson}; use ruma_identifiers::{EventId, RoomId}; ruma_api! { @@ -26,7 +26,7 @@ ruma_api! { response { /// Arbitrary JSON of the event body. Returns both room and state events. - pub event: EventJson, + pub event: EventJson, } error: crate::Error diff --git a/ruma-client-api/src/r0/search/search_events.rs b/ruma-client-api/src/r0/search/search_events.rs index 1e07ff62..6e5e3db4 100644 --- a/ruma-client-api/src/r0/search/search_events.rs +++ b/ruma-client-api/src/r0/search/search_events.rs @@ -4,10 +4,7 @@ use std::collections::BTreeMap; use js_int::UInt; use ruma_api::ruma_api; -use ruma_events::{ - collections::all::{Event, StateEvent}, - EventJson, -}; +use ruma_events::{AnyEvent, AnyStateEvent, EventJson}; use ruma_identifiers::{EventId, RoomId, UserId}; use serde::{Deserialize, Serialize}; @@ -122,11 +119,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(skip_serializing_if = "Option::is_none")] @@ -219,7 +216,7 @@ pub struct RoomEventJsons { /// The current state for every room in the results. This is included if the request had the /// `include_state` key set with a value of `true`. #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] - pub state: BTreeMap>>, + pub state: BTreeMap>>, /// List of words which should be highlighted, useful for stemming which may /// change the query terms. @@ -256,7 +253,7 @@ pub struct SearchResult { /// The event that matched. #[serde(skip_serializing_if = "Option::is_none")] - pub result: Option>, + pub result: Option>, } /// A user profile. diff --git a/ruma-client-api/src/r0/state/get_state_events.rs b/ruma-client-api/src/r0/state/get_state_events.rs index 6947b717..54202e53 100644 --- a/ruma-client-api/src/r0/state/get_state_events.rs +++ b/ruma-client-api/src/r0/state/get_state_events.rs @@ -1,7 +1,7 @@ //! [GET /_matrix/client/r0/rooms/{roomId}/state](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-rooms-roomid-state) use ruma_api::ruma_api; -use ruma_events::{collections::all::StateEvent, EventJson}; +use ruma_events::{AnyStateEvent, EventJson}; use ruma_identifiers::RoomId; ruma_api! { @@ -25,7 +25,7 @@ ruma_api! { /// list of events. If the user has left the room then this will be the state of the /// room when they left as a list of events. #[ruma_api(body)] - pub room_state: Vec>, + pub room_state: Vec>, } error: crate::Error diff --git a/ruma-client-api/src/r0/sync/sync_events.rs b/ruma-client-api/src/r0/sync/sync_events.rs index 356def78..44146b07 100644 --- a/ruma-client-api/src/r0/sync/sync_events.rs +++ b/ruma-client-api/src/r0/sync/sync_events.rs @@ -5,14 +5,8 @@ use std::{collections::BTreeMap, time::Duration}; use js_int::UInt; use ruma_api::ruma_api; use ruma_events::{ - collections::{ - all::{RoomEvent, StateEvent}, - only::Event as NonRoomEvent, - }, - presence::PresenceEvent, - stripped::AnyStrippedStateEvent, - to_device::AnyToDeviceEvent, - EventJson, + presence::PresenceEvent, AnyBasicEvent, AnyEphemeralRoomEvent, AnyRoomEvent, AnyStateEvent, + AnyStrippedStateEventStub, AnyToDeviceEvent, EventJson, }; use ruma_identifiers::{RoomId, UserId}; use serde::{Deserialize, Serialize}; @@ -249,7 +243,7 @@ pub struct Timeline { pub prev_batch: Option, /// A list of events. - pub events: Vec>, + pub events: Vec>, } impl Timeline { @@ -263,7 +257,7 @@ impl Timeline { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct State { /// A list of state events. - pub events: Vec>, + pub events: Vec>, } impl State { @@ -277,7 +271,7 @@ impl State { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct AccountData { /// A list of events. - pub events: Vec>, + pub events: Vec>, } impl AccountData { @@ -291,7 +285,7 @@ impl AccountData { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Ephemeral { /// A list of events. - pub events: Vec>, + pub events: Vec>, } impl Ephemeral { @@ -350,7 +344,7 @@ impl InvitedRoom { #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct InviteState { /// A list of state events. - pub events: Vec>, + pub events: Vec>, } impl InviteState { diff --git a/ruma-events/ruma-events-macros/CHANGELOG.md b/ruma-events-macros/CHANGELOG.md similarity index 100% rename from ruma-events/ruma-events-macros/CHANGELOG.md rename to ruma-events-macros/CHANGELOG.md diff --git a/ruma-events/ruma-events-macros/Cargo.toml b/ruma-events-macros/Cargo.toml similarity index 91% rename from ruma-events/ruma-events-macros/Cargo.toml rename to ruma-events-macros/Cargo.toml index b8ff54af..ad801476 100644 --- a/ruma-events/ruma-events-macros/Cargo.toml +++ b/ruma-events-macros/Cargo.toml @@ -21,7 +21,7 @@ proc-macro2 = "1.0.17" proc-macro = true [dev-dependencies] -ruma-identifiers = "0.16.1" +ruma-identifiers = { version = "0.16.1", path = "../ruma-identifiers" } serde_json = "1.0.53" js_int = { version = "0.1.5", features = ["serde"] } serde = { version = "1.0.110", features = ["derive"] } diff --git a/ruma-events/ruma-events-macros/README.md b/ruma-events-macros/README.md similarity index 100% rename from ruma-events/ruma-events-macros/README.md rename to ruma-events-macros/README.md diff --git a/ruma-events/ruma-events-macros/src/content_enum.rs b/ruma-events-macros/src/content_enum.rs similarity index 92% rename from ruma-events/ruma-events-macros/src/content_enum.rs rename to ruma-events-macros/src/content_enum.rs index 11403f62..a87742ac 100644 --- a/ruma-events/ruma-events-macros/src/content_enum.rs +++ b/ruma-events-macros/src/content_enum.rs @@ -14,11 +14,7 @@ pub fn expand_content_enum(input: ContentEnumInput) -> syn::Result let event_type_str = &input.events; let variants = input.events.iter().map(to_camel_case).collect::>(); - let content = input - .events - .iter() - .map(to_event_content_path) - .collect::>(); + let content = input.events.iter().map(to_event_content_path).collect::>(); let content_enum = quote! { #( #attrs )* @@ -116,10 +112,7 @@ pub(crate) fn to_camel_case(name: &LitStr) -> Ident { let name = name.value(); if &name[..2] != "m." { - panic!( - "well-known matrix events have to start with `m.` found `{}`", - name, - ) + panic!("well-known matrix events have to start with `m.` found `{}`", name,) } let s = name[2..] @@ -170,11 +163,7 @@ impl Parse for ContentEnumInput { .elems .into_iter() .map(|item| { - if let Expr::Lit(ExprLit { - lit: Lit::Str(lit_str), - .. - }) = item - { + if let Expr::Lit(ExprLit { lit: Lit::Str(lit_str), .. }) = item { Ok(lit_str) } else { let msg = "values of field `events` are required to be a string literal"; @@ -183,10 +172,6 @@ impl Parse for ContentEnumInput { }) .collect::>()?; - Ok(Self { - attrs, - name, - events, - }) + Ok(Self { attrs, name, events }) } } diff --git a/ruma-events/ruma-events-macros/src/event.rs b/ruma-events-macros/src/event.rs similarity index 100% rename from ruma-events/ruma-events-macros/src/event.rs rename to ruma-events-macros/src/event.rs diff --git a/ruma-events/ruma-events-macros/src/event_content.rs b/ruma-events-macros/src/event_content.rs similarity index 96% rename from ruma-events/ruma-events-macros/src/event_content.rs rename to ruma-events-macros/src/event_content.rs index ed4e2922..759bd453 100644 --- a/ruma-events/ruma-events-macros/src/event_content.rs +++ b/ruma-events-macros/src/event_content.rs @@ -27,11 +27,8 @@ impl Parse for EventMeta { pub fn expand_event_content(input: DeriveInput) -> syn::Result { let ident = &input.ident; - let event_type_attr = input - .attrs - .iter() - .find(|attr| attr.path.is_ident("ruma_event")) - .ok_or_else(|| { + let event_type_attr = + input.attrs.iter().find(|attr| attr.path.is_ident("ruma_event")).ok_or_else(|| { let msg = "no event type attribute found, \ add `#[ruma_event(type = \"any.room.event\")]` \ below the event content derive"; diff --git a/ruma-events/ruma-events-macros/src/lib.rs b/ruma-events-macros/src/lib.rs similarity index 75% rename from ruma-events/ruma-events-macros/src/lib.rs rename to ruma-events-macros/src/lib.rs index fa8efe6c..d07d5830 100644 --- a/ruma-events/ruma-events-macros/src/lib.rs +++ b/ruma-events-macros/src/lib.rs @@ -2,11 +2,7 @@ //! [ruma-events](https://github.com/ruma/ruma-events) events. //! //! See the documentation for the individual macros for usage details. -#![deny( - missing_copy_implementations, - missing_debug_implementations, - missing_docs -)] +#![deny(missing_copy_implementations, missing_debug_implementations, missing_docs)] extern crate proc_macro; @@ -33,70 +29,54 @@ mod event_content; #[proc_macro] pub fn event_content_enum(input: TokenStream) -> TokenStream { let content_enum_input = syn::parse_macro_input!(input as ContentEnumInput); - expand_content_enum(content_enum_input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_content_enum(content_enum_input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::EventContent`. #[proc_macro_derive(EventContent, attributes(ruma_event))] pub fn derive_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::BasicEventContent` and it's super traits. #[proc_macro_derive(BasicEventContent, attributes(ruma_event))] pub fn derive_basic_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_basic_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_basic_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::RoomEventContent` and it's super traits. #[proc_macro_derive(RoomEventContent, attributes(ruma_event))] pub fn derive_room_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_room_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_room_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::MessageEventContent` and it's super traits. #[proc_macro_derive(MessageEventContent, attributes(ruma_event))] pub fn derive_message_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_message_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_message_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::StateEventContent` and it's super traits. #[proc_macro_derive(StateEventContent, attributes(ruma_event))] pub fn derive_state_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_state_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_state_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates an implementation of `ruma_events::EphemeralRoomEventContent` and it's super traits. #[proc_macro_derive(EphemeralRoomEventContent, attributes(ruma_event))] pub fn derive_ephemeral_room_event_content(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_ephemeral_room_event_content(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_ephemeral_room_event_content(input).unwrap_or_else(|err| err.to_compile_error()).into() } /// Generates implementations needed to serialize and deserialize Matrix events. #[proc_macro_derive(Event, attributes(ruma_event))] pub fn derive_state_event(input: TokenStream) -> TokenStream { let input = parse_macro_input!(input as DeriveInput); - expand_event(input) - .unwrap_or_else(|err| err.to_compile_error()) - .into() + expand_event(input).unwrap_or_else(|err| err.to_compile_error()).into() } diff --git a/ruma-events/.builds/beta.yml b/ruma-events/.builds/beta.yml deleted file mode 100644 index 39c4b574..00000000 --- a/ruma-events/.builds/beta.yml +++ /dev/null @@ -1,27 +0,0 @@ -image: archlinux -packages: - - rustup -sources: - - https://github.com/ruma/ruma-events -tasks: - - rustup: | - # We specify --profile minimal because we'd otherwise download docs - rustup toolchain install beta --profile minimal -c rustfmt -c clippy - rustup default beta - - test: | - cd ruma-events - - # We don't want the build to stop on individual failure of independent - # tools, so capture tool exit codes and set the task exit code manually - set +e - - cargo fmt -- --check - fmt_exit=$? - - cargo clippy --all-targets --all-features -- -D warnings - clippy_exit=$? - - cargo test --verbose - test_exit=$? - - exit $(( $fmt_exit || $clippy_exit || $test_exit )) diff --git a/ruma-events/.builds/msrv.yml b/ruma-events/.builds/msrv.yml deleted file mode 100644 index 3557d9a4..00000000 --- a/ruma-events/.builds/msrv.yml +++ /dev/null @@ -1,16 +0,0 @@ -image: archlinux -packages: - - rustup -sources: - - https://github.com/ruma/ruma-events -tasks: - - rustup: | - # We specify --profile minimal because we'd otherwise download docs - rustup toolchain install 1.40.0 --profile minimal - rustup default 1.40.0 - - test: | - cd ruma-events - - # Only make sure the code builds with the MSRV. Tests can require later - # Rust versions, don't compile or run them. - cargo build --verbose diff --git a/ruma-events/.builds/nightly.yml b/ruma-events/.builds/nightly.yml deleted file mode 100644 index b9c6bac9..00000000 --- a/ruma-events/.builds/nightly.yml +++ /dev/null @@ -1,32 +0,0 @@ -image: archlinux -packages: - - rustup -sources: - - https://github.com/ruma/ruma-events -tasks: - - rustup: | - rustup toolchain install nightly --profile minimal - rustup default nightly - - # Try installing rustfmt & clippy for nightly, but don't fail the build - # if they are not available - rustup component add rustfmt || true - rustup component add clippy || true - - test: | - cd ruma-events - - # We don't want the build to stop on individual failure of independent - # tools, so capture tool exit codes and set the task exit code manually - set +e - - if ( rustup component list | grep -q rustfmt ); then - cargo fmt -- --check - fi - fmt_exit=$? - - if ( rustup component list | grep -q clippy ); then - cargo clippy --all-targets --all-features -- -D warnings - fi - clippy_exit=$? - - exit $(( $fmt_exit || $clippy_exit )) diff --git a/ruma-events/.builds/stable.yml b/ruma-events/.builds/stable.yml deleted file mode 100644 index 598d69f1..00000000 --- a/ruma-events/.builds/stable.yml +++ /dev/null @@ -1,29 +0,0 @@ -image: archlinux -packages: - - rustup -sources: - - https://github.com/ruma/ruma-events -tasks: - - rustup: | - # We specify --profile minimal because we'd otherwise download docs - rustup toolchain install stable --profile minimal -c rustfmt -c clippy - rustup default stable - - test: | - cd ruma-events - - # We don't want the build to stop on individual failure of independent - # tools, so capture tool exit codes and set the task exit code manually - set +e - - cargo fmt -- --check - fmt_exit=$? - - cargo clippy --all-targets --all-features -- -D warnings - clippy_exit=$? - - cargo test --verbose - test_exit=$? - - exit $(( $fmt_exit || $clippy_exit || $test_exit )) - # TODO: Add audit task once cargo-audit binary releases are available. - # See https://github.com/RustSec/cargo-audit/issues/66 diff --git a/ruma-events/.gitignore b/ruma-events/.gitignore deleted file mode 100644 index 50e961f4..00000000 --- a/ruma-events/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -Cargo.lock -target - -# trybuild generates a `wip` folder when creating or updating a test -wip diff --git a/ruma-events/Cargo.toml b/ruma-events/Cargo.toml index 633d0056..23c50476 100644 --- a/ruma-events/Cargo.toml +++ b/ruma-events/Cargo.toml @@ -14,10 +14,10 @@ edition = "2018" [dependencies] js_int = { version = "0.1.5", features = ["serde"] } -ruma-common = "0.1.3" -ruma-events-macros = { path = "ruma-events-macros", version = "=0.21.3" } -ruma-identifiers = "0.16.2" -ruma-serde = "0.2.2" +ruma-common = { version = "0.1.3", path = "../ruma-common" } +ruma-events-macros = { version = "=0.21.3", path = "../ruma-events-macros" } +ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers" } +ruma-serde = { version = "0.2.2", path = "../ruma-serde" } serde = { version = "1.0.111", features = ["derive"] } serde_json = { version = "1.0.53", features = ["raw_value"] } strum = { version = "0.18.0", features = ["derive"] } @@ -25,10 +25,5 @@ strum = { version = "0.18.0", features = ["derive"] } [dev-dependencies] maplit = "1.0.2" matches = "0.1.8" -ruma-identifiers = { version = "0.16.2", features = ["rand"] } +ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers", features = ["rand"] } trybuild = "1.0.28" - -[workspace] -members = [ - "ruma-events-macros", -] diff --git a/ruma-federation-api/Cargo.toml b/ruma-federation-api/Cargo.toml index 94bb6889..38c0b7dc 100644 --- a/ruma-federation-api/Cargo.toml +++ b/ruma-federation-api/Cargo.toml @@ -19,8 +19,8 @@ version = "0.0.2" js_int = "0.1.5" matches = "0.1.8" ruma-api = { version = "0.16.1", path = "../ruma-api" } -ruma-events = { git = "https://github.com/ruma/ruma-events", rev = "c1ee72d" } +ruma-events = { version = "0.21.3", path = "../ruma-events" } ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers" } -ruma-serde = "0.2.2" +ruma-serde = { version = "0.2.2", path = "../ruma-serde" } serde = { version = "1.0.111", features = ["derive"] } serde_json = "1.0.53" diff --git a/ruma/Cargo.toml b/ruma/Cargo.toml index 5410beb0..f86208ca 100644 --- a/ruma/Cargo.toml +++ b/ruma/Cargo.toml @@ -24,7 +24,7 @@ federation-api = ["ruma-api", "ruma-federation-api", "ruma-signatures"] ruma-common = { version = "0.1.3", path = "../ruma-common" } ruma-identifiers = { version = "0.16.2", path = "../ruma-identifiers", features = ["serde"] } -ruma-events = { git = "https://github.com/ruma/ruma-events", rev = "c1ee72d", optional = true } +ruma-events = { version = "0.21.3", path = "../ruma-events", optional = true } ruma-signatures = { version = "0.6.0-dev.1", path = "../ruma-signatures", optional = true } ruma-api = { version = "0.16.1", path = "../ruma-api", optional = true }