From 586bca680db489ccafa4a07ec7f8ad41a2dc4ea0 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Sun, 13 Jan 2019 21:12:33 +0100 Subject: [PATCH] Re-run 'cargo fmt' --- src/lib.rs | 3 ++- src/r0/account.rs | 6 +++--- src/r0/config.rs | 2 +- src/r0/contact.rs | 2 +- src/r0/context.rs | 4 ++-- src/r0/directory.rs | 2 +- src/r0/membership.rs | 2 +- src/r0/presence.rs | 2 +- src/r0/redact.rs | 2 +- src/r0/room.rs | 10 +++++----- src/r0/search.rs | 18 +++++++++--------- src/r0/send.rs | 8 ++++---- src/r0/sync.rs | 11 +++++++---- src/r0/tag.rs | 6 +++--- src/r0/typing.rs | 2 +- 15 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 746f2bfa..3695492f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,8 @@ extern crate ruma_identifiers; extern crate ruma_signatures; extern crate serde; extern crate serde_json; -#[macro_use] extern crate serde_derive; +#[macro_use] +extern crate serde_derive; extern crate serde_urlencoded; extern crate url; diff --git a/src/r0/account.rs b/src/r0/account.rs index d60fbe12..32aba8de 100644 --- a/src/r0/account.rs +++ b/src/r0/account.rs @@ -81,7 +81,7 @@ pub mod register { #[serde(rename = "type")] kind: String, /// The value of the session key given by the homeserver. - session: Option + session: Option, } /// The kind of account being registered. @@ -90,10 +90,10 @@ pub mod register { /// A guest account /// /// These accounts may have limited permissions and may not be supported by all servers. - #[serde(rename="guest")] + #[serde(rename = "guest")] Guest, /// A regular user account - #[serde(rename="user")] + #[serde(rename = "user")] User, } } diff --git a/src/r0/config.rs b/src/r0/config.rs index 51336a2f..975b3ea0 100644 --- a/src/r0/config.rs +++ b/src/r0/config.rs @@ -40,7 +40,7 @@ pub mod set_room_account_data { } /// [PUT /_matrix/client/r0/user/{userId}/account_data/{type}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-user-userid-account-data-type) -pub mod set_global_account_data { +pub mod set_global_account_data { use ruma_api_macros::ruma_api; use ruma_identifiers::UserId; use serde_json::Value; diff --git a/src/r0/contact.rs b/src/r0/contact.rs index 896e0a26..2f646be2 100644 --- a/src/r0/contact.rs +++ b/src/r0/contact.rs @@ -67,7 +67,7 @@ pub mod get_contacts { #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum Medium { /// An email address. - #[serde(rename="email")] + #[serde(rename = "email")] Email, } diff --git a/src/r0/context.rs b/src/r0/context.rs index 07fb825f..261f0b3b 100644 --- a/src/r0/context.rs +++ b/src/r0/context.rs @@ -2,9 +2,9 @@ /// [GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-rooms-roomid-context-eventid) pub mod get_context { - use ruma_identifiers::{EventId, RoomId}; - use ruma_events::collections::only; use ruma_api_macros::ruma_api; + use ruma_events::collections::only; + use ruma_identifiers::{EventId, RoomId}; ruma_api! { metadata { diff --git a/src/r0/directory.rs b/src/r0/directory.rs index 6b513fef..7a00037b 100644 --- a/src/r0/directory.rs +++ b/src/r0/directory.rs @@ -2,8 +2,8 @@ /// [GET /_matrix/client/r0/publicRooms](https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-publicrooms) pub mod get_public_rooms { - use ruma_identifiers::{RoomId, RoomAliasId}; use ruma_api_macros::ruma_api; + use ruma_identifiers::{RoomAliasId, RoomId}; ruma_api! { metadata { diff --git a/src/r0/membership.rs b/src/r0/membership.rs index ae002046..a8dc7503 100644 --- a/src/r0/membership.rs +++ b/src/r0/membership.rs @@ -22,7 +22,7 @@ pub struct ThirdPartySigned { /// [POST /_matrix/client/r0/rooms/{roomId}/invite](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-invite) pub mod invite_user { use ruma_api_macros::ruma_api; - use ruma_identifiers::{UserId, RoomId}; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata { diff --git a/src/r0/presence.rs b/src/r0/presence.rs index c9d03344..c39cf7e7 100644 --- a/src/r0/presence.rs +++ b/src/r0/presence.rs @@ -3,8 +3,8 @@ /// [PUT /_matrix/client/r0/presence/{userId}/status](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-presence-userid-status) pub mod set_presence { use ruma_api_macros::ruma_api; - use ruma_identifiers::UserId; use ruma_events::presence::PresenceState; + use ruma_identifiers::UserId; ruma_api! { metadata { diff --git a/src/r0/redact.rs b/src/r0/redact.rs index 5d83a5a6..cf014d25 100644 --- a/src/r0/redact.rs +++ b/src/r0/redact.rs @@ -3,7 +3,7 @@ /// [PUT /_matrix/client/r0/rooms/{roomId}/redact/{eventId}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid) pub mod redact_event { use ruma_api_macros::ruma_api; - use ruma_identifiers::{RoomId, EventId}; + use ruma_identifiers::{EventId, RoomId}; ruma_api! { metadata { diff --git a/src/r0/room.rs b/src/r0/room.rs index 1435497e..ccf37b18 100644 --- a/src/r0/room.rs +++ b/src/r0/room.rs @@ -2,8 +2,8 @@ /// [POST /_matrix/client/r0/createRoom](https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom) pub mod create_room { - use ruma_identifiers::{RoomId, UserId}; use ruma_api_macros::ruma_api; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata { @@ -59,7 +59,7 @@ pub mod create_room { /// Whether users on other servers can join this room. /// /// Defaults to `true` if key does not exist. - #[serde(rename="m.federate")] + #[serde(rename = "m.federate")] #[serde(skip_serializing_if = "Option::is_none")] pub federate: Option, } @@ -68,13 +68,13 @@ pub mod create_room { #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum RoomPreset { /// `join_rules` is set to `invite` and `history_visibility` is set to `shared`. - #[serde(rename="private_chat")] + #[serde(rename = "private_chat")] PrivateChat, /// `join_rules` is set to `public` and `history_visibility` is set to `shared`. - #[serde(rename="public_chat")] + #[serde(rename = "public_chat")] PublicChat, /// Same as `PrivateChat`, but all initial invitees get the same power level as the creator. - #[serde(rename="trusted_private_chat")] + #[serde(rename = "trusted_private_chat")] TrustedPrivateChat, } diff --git a/src/r0/search.rs b/src/r0/search.rs index ff6f2cb6..c11460d8 100644 --- a/src/r0/search.rs +++ b/src/r0/search.rs @@ -41,7 +41,7 @@ pub mod search_events { pub struct Categories { /// Criteria for searching a category of events. #[serde(skip_serializing_if = "Option::is_none")] - pub room_events: Option + pub room_events: Option, } /// Criteria for searching a category of events. @@ -107,17 +107,17 @@ pub mod search_events { #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Grouping { /// The key within events to use for this grouping. - pub key: GroupingKey + pub key: GroupingKey, } /// The key within events to use for this grouping. #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] pub enum GroupingKey { /// `room_id` - #[serde(rename="room_id")] + #[serde(rename = "room_id")] RoomId, /// `sender` - #[serde(rename="sender")] + #[serde(rename = "sender")] Sender, } @@ -132,13 +132,13 @@ pub mod search_events { #[derive(Clone, Copy, Debug, Deserialize, Serialize)] pub enum SearchKeys { /// content.body - #[serde(rename="content.body")] + #[serde(rename = "content.body")] ContentBody, /// content.name - #[serde(rename="content.name")] + #[serde(rename = "content.name")] ContentName, /// content.topic - #[serde(rename="content.topic")] + #[serde(rename = "content.topic")] ContentTopic, } @@ -147,10 +147,10 @@ pub mod search_events { pub enum OrderBy { /// Prioritize events by a numerical ranking of how closely they matched the search /// criteria. - #[serde(rename="rank")] + #[serde(rename = "rank")] Rank, /// Prioritize recent events. - #[serde(rename="recent")] + #[serde(rename = "recent")] Recent, } diff --git a/src/r0/send.rs b/src/r0/send.rs index 21cd1e55..70269810 100644 --- a/src/r0/send.rs +++ b/src/r0/send.rs @@ -3,8 +3,8 @@ /// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype) pub mod send_state_event_for_empty_key { use ruma_api_macros::ruma_api; - use ruma_identifiers::{RoomId, EventId}; use ruma_events::EventType; + use ruma_identifiers::{EventId, RoomId}; use serde_json::Value; ruma_api! { @@ -39,8 +39,8 @@ pub mod send_state_event_for_empty_key { /// [PUT /_matrix/client/r0/rooms/{roomId}/state/{eventType}/{stateKey}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-state-eventtype-statekey) pub mod send_state_event_for_key { use ruma_api_macros::ruma_api; - use ruma_identifiers::{RoomId, EventId}; use ruma_events::EventType; + use ruma_identifiers::{EventId, RoomId}; use serde_json::Value; ruma_api! { @@ -78,9 +78,9 @@ pub mod send_state_event_for_key { /// [PUT /_matrix/client/r0/rooms/{roomId}/send/{eventType}/{txnId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid) pub mod send_message_event { use ruma_api_macros::ruma_api; - use ruma_identifiers::{RoomId, EventId}; - use ruma_events::EventType; use ruma_events::room::message::MessageEventContent; + use ruma_events::EventType; + use ruma_identifiers::{EventId, RoomId}; ruma_api! { metadata { diff --git a/src/r0/sync.rs b/src/r0/sync.rs index 8a4e66de..66710a8b 100644 --- a/src/r0/sync.rs +++ b/src/r0/sync.rs @@ -186,10 +186,10 @@ pub mod get_message_events { #[derive(Clone, Debug, Deserialize, Serialize)] pub enum Direction { /// Return events backwards in time from the requested `from` token. - #[serde(rename="b")] + #[serde(rename = "b")] Backward, /// Return events forwards in time from the requested `from` token. - #[serde(rename="f")] + #[serde(rename = "f")] Forward, } } @@ -199,7 +199,10 @@ pub mod sync_events { use std::collections::HashMap; use ruma_api_macros::ruma_api; - use ruma_events::{collections::{all, only}, stripped}; + use ruma_events::{ + collections::{all, only}, + stripped, + }; use ruma_identifiers::RoomId; use r0::filter::FilterDefinition; @@ -252,7 +255,7 @@ pub mod sync_events { #[derive(Clone, Debug, Deserialize, Serialize)] pub enum SetPresence { /// Do not set the presence of the user calling this API. - #[serde(rename="offline")] + #[serde(rename = "offline")] Offline, } diff --git a/src/r0/tag.rs b/src/r0/tag.rs index f6e5e333..1d3a893e 100644 --- a/src/r0/tag.rs +++ b/src/r0/tag.rs @@ -4,7 +4,7 @@ pub mod create_tag { use ruma_api_macros::ruma_api; use ruma_events::tag::TagInfo; - use ruma_identifiers::{UserId, RoomId}; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata { @@ -39,7 +39,7 @@ pub mod create_tag { pub mod get_tags { use ruma_api_macros::ruma_api; use ruma_events::tag::TagEventContent; - use ruma_identifiers::{UserId, RoomId}; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata { @@ -70,7 +70,7 @@ pub mod get_tags { /// [DELETE /_matrix/client/r0/user/{userId}/rooms/{roomId}/tags/{tag}](https://matrix.org/docs/spec/client_server/r0.2.0.html#delete-matrix-client-r0-user-userid-rooms-roomid-tags-tag) pub mod delete_tag { use ruma_api_macros::ruma_api; - use ruma_identifiers::{UserId, RoomId}; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata { diff --git a/src/r0/typing.rs b/src/r0/typing.rs index eac4f8e8..9b8c2929 100644 --- a/src/r0/typing.rs +++ b/src/r0/typing.rs @@ -3,7 +3,7 @@ /// [PUT /_matrix/client/r0/rooms/{roomId}/typing/{userId}](https://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-typing-userid) pub mod create_typing_event { use ruma_api_macros::ruma_api; - use ruma_identifiers::{UserId, RoomId}; + use ruma_identifiers::{RoomId, UserId}; ruma_api! { metadata {