diff --git a/xmpp-parsers/src/bob.rs b/xmpp-parsers/src/bob.rs index e67564409b6805241e515feaa183c86325ad796d..101a7490ee177588f29f49f31189fafdc40d0cc0 100644 --- a/xmpp-parsers/src/bob.rs +++ b/xmpp-parsers/src/bob.rs @@ -14,7 +14,7 @@ use std::str::FromStr; /// /// The text value SHOULD be of the form algo+hash@bob.xmpp.org, this struct /// enforces that format. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct ContentId { hash: Hash, } diff --git a/xmpp-parsers/src/data_forms.rs b/xmpp-parsers/src/data_forms.rs index 11603b3e67b689ac7f27fb41ffed0e7eb50acea8..596a3176081c9f5349bd7258ebda0b81411fdaf0 100644 --- a/xmpp-parsers/src/data_forms.rs +++ b/xmpp-parsers/src/data_forms.rs @@ -69,7 +69,7 @@ generate_attribute!( ); /// Represents a field in a [data form](struct.DataForm.html). -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Field { /// The unique identifier for this field, in the form. pub var: String, @@ -187,7 +187,7 @@ generate_attribute!( ); /// This is a form to be sent to another entity for filling. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct DataForm { /// The type of this form, telling the other party which action to execute. pub type_: DataFormType, diff --git a/xmpp-parsers/src/disco.rs b/xmpp-parsers/src/disco.rs index 6ed2c13f7a01901df6c66eedca1a87e5a6f57754..3a1890d7fe490b26cb0567999da7df3641ab9161 100644 --- a/xmpp-parsers/src/disco.rs +++ b/xmpp-parsers/src/disco.rs @@ -27,7 +27,6 @@ impl IqGetPayload for DiscoInfoQuery {} generate_element!( /// Structure representing a `` element. -#[derive(PartialEq)] Feature, "feature", DISCO_INFO, attributes: [ /// Namespace of the feature we want to represent. diff --git a/xmpp-parsers/src/hashes.rs b/xmpp-parsers/src/hashes.rs index 964719f00dcfcc4c8a6196bc4b2f16718bed7c6c..704af5233f869a013159251cbbbf34bfd18028b6 100644 --- a/xmpp-parsers/src/hashes.rs +++ b/xmpp-parsers/src/hashes.rs @@ -97,7 +97,6 @@ impl IntoAttributeValue for Algo { generate_element!( /// This element represents a hash of some data, defined by the hash /// algorithm used and the computed value. - #[derive(PartialEq)] Hash, "hash", HASHES, attributes: [ /// The algorithm used to create this hash. diff --git a/xmpp-parsers/src/jingle.rs b/xmpp-parsers/src/jingle.rs index 7888876981eb5762e7a63deb0c7e4198d2e65827..f4d84009eed9c0730788ee48812ac8ecf2de64ed 100644 --- a/xmpp-parsers/src/jingle.rs +++ b/xmpp-parsers/src/jingle.rs @@ -171,7 +171,7 @@ generate_id!( ); /// Enum wrapping all of the various supported descriptions of a Content. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum Description { /// Jingle RTP Sessions (XEP-0167) description. Rtp(RtpDescription), @@ -208,7 +208,7 @@ impl From for Element { } /// Enum wrapping all of the various supported transports of a Content. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum Transport { /// Jingle ICE-UDP Bytestreams (XEP-0176) transport. IceUdp(IceUdpTransport), @@ -465,7 +465,7 @@ impl From for Element { type Lang = String; /// Informs the recipient of something. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct ReasonElement { /// The list of possible reasons to be included in a Jingle iq. pub reason: Reason, @@ -541,7 +541,7 @@ generate_id!( ); /// The main Jingle container, to be included in an iq stanza. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Jingle { /// The action to execute on both ends. pub action: Action, diff --git a/xmpp-parsers/src/jingle_ft.rs b/xmpp-parsers/src/jingle_ft.rs index 85ab5ec6589a7621c69054690bf4143405e95d81..d44b7e174438514e2d73c44839e3d885fbce9248 100644 --- a/xmpp-parsers/src/jingle_ft.rs +++ b/xmpp-parsers/src/jingle_ft.rs @@ -16,7 +16,7 @@ use std::str::FromStr; generate_element!( /// Represents a range in a file. - #[derive(PartialEq, Default)] + #[derive(Default)] Range, "range", JINGLE_FT, attributes: [ /// The offset in bytes from the beginning of the file. diff --git a/xmpp-parsers/src/jingle_grouping.rs b/xmpp-parsers/src/jingle_grouping.rs index 310e09c3b053586c787c2336286d20f4b2a11d15..01c882d9d867849f59736c3ecc260f93f168ba0d 100644 --- a/xmpp-parsers/src/jingle_grouping.rs +++ b/xmpp-parsers/src/jingle_grouping.rs @@ -18,7 +18,6 @@ generate_attribute!( ); generate_element!( - #[derive(PartialEq)] /// Describes a content that should be grouped with other ones. Content, "content", JINGLE_GROUPING, attributes: [ diff --git a/xmpp-parsers/src/jingle_s5b.rs b/xmpp-parsers/src/jingle_s5b.rs index 10634d0f3c1016cfde0eda9fa84d818892abb9ac..e481f56f9d1ecaa0f94a0c03851cdeac8e8496fb 100644 --- a/xmpp-parsers/src/jingle_s5b.rs +++ b/xmpp-parsers/src/jingle_s5b.rs @@ -102,7 +102,7 @@ impl Candidate { } /// The payload of a transport. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum TransportPayload { /// The responder informs the initiator that the bytestream pointed by this /// candidate has been activated. @@ -126,7 +126,7 @@ pub enum TransportPayload { } /// Describes a Jingle transport using a direct or proxied connection. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Transport { /// The stream identifier for this transport. pub sid: StreamId, diff --git a/xmpp-parsers/src/message.rs b/xmpp-parsers/src/message.rs index f473010d48590434d1540059c8f2744149dfca13..281543a2f1fa0b3165e90f95bc9cc01d770d5f3e 100644 --- a/xmpp-parsers/src/message.rs +++ b/xmpp-parsers/src/message.rs @@ -61,7 +61,7 @@ generate_elem_id!( ); /// The main structure representing the `` stanza. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Message { /// The JID emitting this stanza. pub from: Option, diff --git a/xmpp-parsers/src/muc/muc.rs b/xmpp-parsers/src/muc/muc.rs index ef5186dbf2f13ffb4151fdb3f65f58c3ebb2ffa3..edce30389445d571f749c4e30ec94a306367571a 100644 --- a/xmpp-parsers/src/muc/muc.rs +++ b/xmpp-parsers/src/muc/muc.rs @@ -10,7 +10,7 @@ use crate::presence::PresencePayload; generate_element!( /// Represents the query for messages before our join. - #[derive(PartialEq, Default)] + #[derive(Default)] History, "history", MUC, attributes: [ /// How many characters of history to send, in XML characters. @@ -60,7 +60,7 @@ impl History { generate_element!( /// Represents a room join request. - #[derive(PartialEq, Default)] + #[derive(Default)] Muc, "x", MUC, children: [ /// Password to use when the room is protected by a password. password: Option = ("password", MUC) => String, diff --git a/xmpp-parsers/src/pubsub/mod.rs b/xmpp-parsers/src/pubsub/mod.rs index ee668ffb52c45a7925b67ec768174e3652e149b8..e639c28a212fa1eaf7ff6a87c983dcc375addd2b 100644 --- a/xmpp-parsers/src/pubsub/mod.rs +++ b/xmpp-parsers/src/pubsub/mod.rs @@ -49,7 +49,7 @@ generate_attribute!( ); /// An item from a PubSub node. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Item { /// The identifier for this item, unique per node. pub id: Option, diff --git a/xmpp-parsers/src/pubsub/pubsub.rs b/xmpp-parsers/src/pubsub/pubsub.rs index d4ad9f81615f9b80dfac5b850d34ddef696cda8e..6184e40241fe06071e3d03caaa0bc8a2f054a664 100644 --- a/xmpp-parsers/src/pubsub/pubsub.rs +++ b/xmpp-parsers/src/pubsub/pubsub.rs @@ -126,7 +126,7 @@ impl Items { } /// Response wrapper for a PubSub ``. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Item(pub PubSubItem); impl_pubsub_item!(Item, PUBSUB); @@ -196,7 +196,7 @@ generate_element!( ); /// Indicate that the subscription can be configured. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct SubscribeOptions { /// If `true`, the configuration is actually required. required: bool, @@ -304,7 +304,7 @@ generate_element!( /// Main payload used to communicate with a PubSub service. /// /// `` -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub enum PubSub { /// Request to create a new node, with optional suggested name and suggested configuration. Create { diff --git a/xmpp-parsers/src/roster.rs b/xmpp-parsers/src/roster.rs index cdf83685ac2a452813497ccbff6c6e65acdc5b78..1695296181314154fea313ae684230c53da8a9b9 100644 --- a/xmpp-parsers/src/roster.rs +++ b/xmpp-parsers/src/roster.rs @@ -46,7 +46,6 @@ generate_attribute!( generate_element!( /// Contact from the user’s contact list. - #[derive(PartialEq)] Item, "item", ROSTER, attributes: [ /// JID of this contact. diff --git a/xmpp-parsers/src/rsm.rs b/xmpp-parsers/src/rsm.rs index 4efb8bcf5bf8b41a7c3f0956fe4b889905d39762..f5649c71e5ab7acd772aa02c52422022aaf4c3ba 100644 --- a/xmpp-parsers/src/rsm.rs +++ b/xmpp-parsers/src/rsm.rs @@ -11,7 +11,7 @@ use std::convert::TryFrom; /// Requests paging through a potentially big set of items (represented by an /// UID). -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct SetQuery { /// Limit the number of items, or use the recipient’s defaults if None. pub max: Option, @@ -92,7 +92,7 @@ impl From for Element { } /// Describes the paging result of a [query](struct.SetQuery.html). -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct SetResult { /// The UID of the first item of the page. pub first: Option, diff --git a/xmpp-parsers/src/util/macros.rs b/xmpp-parsers/src/util/macros.rs index 16d2c406b0c822b925a1b0a5c916ca65d9d4212d..702a16f1bb375b40733e6972211ecb443fae6e12 100644 --- a/xmpp-parsers/src/util/macros.rs +++ b/xmpp-parsers/src/util/macros.rs @@ -370,7 +370,7 @@ macro_rules! check_no_unknown_attributes { macro_rules! generate_empty_element { ($(#[$meta:meta])* $elem:ident, $name:tt, $ns:ident) => ( $(#[$meta])* - #[derive(Debug, Clone)] + #[derive(Debug, Clone, PartialEq)] pub struct $elem; impl ::std::convert::TryFrom for $elem { @@ -642,7 +642,7 @@ macro_rules! generate_element { ); ($(#[$meta:meta])* $elem:ident, $name:tt, $ns:ident, attributes: [$($(#[$attr_meta:meta])* $attr:ident: $attr_action:tt<$attr_type:ty> = $attr_name:tt),*], children: [$($(#[$child_meta:meta])* $child_ident:ident: $coucou:tt<$child_type:ty> = ($child_name:tt, $child_ns:tt) => $child_constructor:ident),*] $(, text: ($(#[$text_meta:meta])* $text_ident:ident: $codec:ident < $text_type:ty >))*) => ( $(#[$meta])* - #[derive(Debug, Clone)] + #[derive(Debug, Clone, PartialEq)] pub struct $elem { $( $(#[$attr_meta])*