Move the Default implementation into more generate_attribute!.

This commit is contained in:
Emmanuel Gil Peyrot 2017-06-14 00:53:18 +01:00
parent 0f297d2d2d
commit ebc7582250
3 changed files with 3 additions and 21 deletions

View file

@ -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_ {

View file

@ -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 {

View file

@ -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;