Merge pull request #24 from ruma/serde-derive-feature

Replace serde_derive by re-exports in serde
This commit is contained in:
Jimmy Cuadra 2019-02-06 13:41:01 -08:00 committed by GitHub
commit df63ab3df9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 30 additions and 31 deletions

View File

@ -14,6 +14,8 @@ edition = "2018"
[dependencies] [dependencies]
ruma-identifiers = "0.11.0" ruma-identifiers = "0.11.0"
ruma-signatures = "0.4.1" ruma-signatures = "0.4.1"
serde = "1.0.80" serde_json = "1.0.38"
serde_derive = "1.0.80"
serde_json = "1.0.33" [dependencies.serde]
version = "1.0.87"
features = ["derive"]

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.answer* event. //! Types for the *m.call.answer* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::SessionDescription; use super::SessionDescription;

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.candidates* event. //! Types for the *m.call.candidates* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
room_event! { room_event! {
/// This event is sent by callers after sending an invite and by the callee after answering. /// This event is sent by callers after sending an invite and by the callee after answering.

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.hangup* event. //! Types for the *m.call.hangup* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
room_event! { room_event! {
/// Sent by either party to signal their termination of the call. This can be sent either once /// Sent by either party to signal their termination of the call. This can be sent either once

View File

@ -1,6 +1,6 @@
//! Types for the *m.call.invite* event. //! Types for the *m.call.invite* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::SessionDescription; use super::SessionDescription;

View File

@ -2,7 +2,7 @@
//! //!
//! This module also contains types shared by events in its child namespaces. //! This module also contains types shared by events in its child namespaces.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub mod answer; pub mod answer;
pub mod candidates; pub mod candidates;

View File

@ -3,7 +3,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use ruma_identifiers::{RoomId, UserId}; use ruma_identifiers::{RoomId, UserId};
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
event! { event! {
/// Informs the client about the rooms that are considered direct by a user. /// Informs the client about the rooms that are considered direct by a user.

View File

@ -107,7 +107,6 @@ use serde::{
de::{Error as SerdeError, Visitor}, de::{Error as SerdeError, Visitor},
Deserialize, Deserializer, Serialize, Serializer, Deserialize, Deserializer, Serialize, Serializer,
}; };
use serde_derive::{Deserialize, Serialize};
use serde_json::Value; use serde_json::Value;
#[macro_use] #[macro_use]

View File

@ -1,6 +1,6 @@
//! Types for the *m.presence* event. //! Types for the *m.presence* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use ruma_identifiers::UserId; use ruma_identifiers::UserId;

View File

@ -3,7 +3,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use ruma_identifiers::{EventId, RoomId, UserId}; use ruma_identifiers::{EventId, RoomId, UserId};
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
event! { event! {
/// Informs the client of new receipts. /// Informs the client of new receipts.

View File

@ -1,7 +1,7 @@
//! Types for the *m.room.aliases* event. //! Types for the *m.room.aliases* event.
use ruma_identifiers::RoomAliasId; use ruma_identifiers::RoomAliasId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// Informs the room about what room aliases it has been given. /// Informs the room about what room aliases it has been given.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.avatar* event. //! Types for the *m.room.avatar* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::ImageInfo; use super::ImageInfo;

View File

@ -1,7 +1,7 @@
//! Types for the *m.room.canonical_alias* event. //! Types for the *m.room.canonical_alias* event.
use ruma_identifiers::RoomAliasId; use ruma_identifiers::RoomAliasId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// Informs the room as to which alias is the canonical one. /// Informs the room as to which alias is the canonical one.

View File

@ -1,7 +1,7 @@
//! Types for the *m.room.create* event. //! Types for the *m.room.create* event.
use ruma_identifiers::UserId; use ruma_identifiers::UserId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// This is the first event in a room and cannot be changed. It acts as the root of all other /// This is the first event in a room and cannot be changed. It acts as the root of all other

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.guest_access* event. //! Types for the *m.room.guest_access* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// Controls whether guest users are allowed to join rooms. /// Controls whether guest users are allowed to join rooms.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.history_visibility* event. //! Types for the *m.room.history_visibility* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// This event controls whether a member of a room can see the events that happened in a room /// This event controls whether a member of a room can see the events that happened in a room

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.join_rules* event. //! Types for the *m.room.join_rules* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// Describes how users are allowed to join the room. /// Describes how users are allowed to join the room.

View File

@ -2,7 +2,7 @@
use ruma_identifiers::UserId; use ruma_identifiers::UserId;
use ruma_signatures::Signatures; use ruma_signatures::Signatures;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::stripped::StrippedState; use crate::stripped::StrippedState;

View File

@ -1,7 +1,6 @@
//! Types for the *m.room.message* event. //! Types for the *m.room.message* event.
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
use serde_derive::{Deserialize, Serialize};
use serde_json::{from_value, Value}; use serde_json::{from_value, Value};
use super::{ImageInfo, ThumbnailInfo}; use super::{ImageInfo, ThumbnailInfo};

View File

@ -2,7 +2,7 @@
//! //!
//! This module also contains types shared by events in its child namespaces. //! This module also contains types shared by events in its child namespaces.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
pub mod aliases; pub mod aliases;
pub mod avatar; pub mod avatar;

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.name* event. //! Types for the *m.room.name* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// A human-friendly room name designed to be displayed to the end-user. /// A human-friendly room name designed to be displayed to the end-user.

View File

@ -1,7 +1,7 @@
//! Types for the *m.room.pinned_events* event. //! Types for the *m.room.pinned_events* event.
use ruma_identifiers::EventId; use ruma_identifiers::EventId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// Used to "pin" particular events in a room for other participants to review later. /// Used to "pin" particular events in a room for other participants to review later.

View File

@ -3,7 +3,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use ruma_identifiers::UserId; use ruma_identifiers::UserId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::EventType; use crate::EventType;

View File

@ -1,7 +1,7 @@
//! Types for the *m.room.redaction* event. //! Types for the *m.room.redaction* event.
use ruma_identifiers::EventId; use ruma_identifiers::EventId;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
room_event! { room_event! {
/// A redaction of an event. /// A redaction of an event.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.third_party_invite* event. //! Types for the *m.room.third_party_invite* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// An invitation to a room issued to a third party identifier, rather than a matrix user ID. /// An invitation to a room issued to a third party identifier, rather than a matrix user ID.

View File

@ -1,6 +1,6 @@
//! Types for the *m.room.topic* event. //! Types for the *m.room.topic* event.
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
state_event! { state_event! {
/// A topic is a short message detailing what is currently being discussed in the room. /// A topic is a short message detailing what is currently being discussed in the room.

View File

@ -7,7 +7,6 @@
use ruma_identifiers::UserId; use ruma_identifiers::UserId;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer}; use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
use serde_derive::{Deserialize, Serialize};
use serde_json::{from_value, Value}; use serde_json::{from_value, Value};
use crate::{ use crate::{

View File

@ -2,7 +2,7 @@
use std::collections::HashMap; use std::collections::HashMap;
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
event! { event! {
/// Informs the client of tags on a room. /// Informs the client of tags on a room.

View File

@ -1,7 +1,7 @@
//! Types for the *m.typing* event. //! Types for the *m.typing* event.
use ruma_identifiers::{RoomId, UserId}; use ruma_identifiers::{RoomId, UserId};
use serde_derive::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
event! { event! {
/// Informs the client of the list of users currently typing. /// Informs the client of the list of users currently typing.