Move the Default implementation into more generate_attribute!.
This commit is contained in:
parent
0f297d2d2d
commit
ebc7582250
3 changed files with 3 additions and 21 deletions
|
@ -25,13 +25,7 @@ generate_attribute!(FieldType, "type", {
|
||||||
TextMulti => "text-multi",
|
TextMulti => "text-multi",
|
||||||
TextPrivate => "text-private",
|
TextPrivate => "text-private",
|
||||||
TextSingle => "text-single",
|
TextSingle => "text-single",
|
||||||
});
|
}, Default = TextSingle);
|
||||||
|
|
||||||
impl Default for FieldType {
|
|
||||||
fn default() -> FieldType {
|
|
||||||
FieldType::TextSingle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Option_ {
|
pub struct Option_ {
|
||||||
|
|
|
@ -41,13 +41,7 @@ generate_attribute!(Senders, "senders", {
|
||||||
Initiator => "initiator",
|
Initiator => "initiator",
|
||||||
None => "none",
|
None => "none",
|
||||||
Responder => "responder",
|
Responder => "responder",
|
||||||
});
|
}, Default = Both);
|
||||||
|
|
||||||
impl Default for Senders {
|
|
||||||
fn default() -> Senders {
|
|
||||||
Senders::Both
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Content {
|
pub struct Content {
|
||||||
|
|
|
@ -108,13 +108,7 @@ generate_attribute!(MessageType, "type", {
|
||||||
Groupchat => "groupchat",
|
Groupchat => "groupchat",
|
||||||
Headline => "headline",
|
Headline => "headline",
|
||||||
Normal => "normal",
|
Normal => "normal",
|
||||||
});
|
}, Default = Normal);
|
||||||
|
|
||||||
impl Default for MessageType {
|
|
||||||
fn default() -> MessageType {
|
|
||||||
MessageType::Normal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type Lang = String;
|
type Lang = String;
|
||||||
type Body = String;
|
type Body = String;
|
||||||
|
|
Loading…
Reference in a new issue