From ebc7582250d8a3e4a4a30576ad32c7bb3b47bbb2 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 14 Jun 2017 00:53:18 +0100 Subject: [PATCH] Move the Default implementation into more generate_attribute!. --- src/data_forms.rs | 8 +------- src/jingle.rs | 8 +------- src/message.rs | 8 +------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/data_forms.rs b/src/data_forms.rs index 0899cc5c..9905f4b4 100644 --- a/src/data_forms.rs +++ b/src/data_forms.rs @@ -25,13 +25,7 @@ generate_attribute!(FieldType, "type", { TextMulti => "text-multi", TextPrivate => "text-private", TextSingle => "text-single", -}); - -impl Default for FieldType { - fn default() -> FieldType { - FieldType::TextSingle - } -} +}, Default = TextSingle); #[derive(Debug, Clone)] pub struct Option_ { diff --git a/src/jingle.rs b/src/jingle.rs index e5fab352..d189684e 100644 --- a/src/jingle.rs +++ b/src/jingle.rs @@ -41,13 +41,7 @@ generate_attribute!(Senders, "senders", { Initiator => "initiator", None => "none", Responder => "responder", -}); - -impl Default for Senders { - fn default() -> Senders { - Senders::Both - } -} +}, Default = Both); #[derive(Debug, Clone)] pub struct Content { diff --git a/src/message.rs b/src/message.rs index 4efabbdb..79038c12 100644 --- a/src/message.rs +++ b/src/message.rs @@ -108,13 +108,7 @@ generate_attribute!(MessageType, "type", { Groupchat => "groupchat", Headline => "headline", Normal => "normal", -}); - -impl Default for MessageType { - fn default() -> MessageType { - MessageType::Normal - } -} +}, Default = Normal); type Lang = String; type Body = String;