xso-proc: Allow #[xml(flag)] without params
The namespace defaults to the parent’s namespace, and the name to the field name, so we can avoid needlessly duplicating that info.
This commit is contained in:
parent
244a9bbbf2
commit
fefc898fdf
4 changed files with 9 additions and 7 deletions
|
|
@ -139,7 +139,7 @@ pub struct Resumed {
|
|||
#[xml(namespace = ns::SM, name = "sm")]
|
||||
pub struct StreamManagement {
|
||||
/// `<optional/>` flag.
|
||||
#[xml(flag(name = "optional"))]
|
||||
#[xml(flag)]
|
||||
pub optional: bool,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub struct Proceed;
|
|||
#[xml(namespace = ns::TLS, name = "starttls")]
|
||||
pub struct StartTls {
|
||||
/// Marker for mandatory StartTLS.
|
||||
#[xml(flag(name = "required"))]
|
||||
#[xml(flag)]
|
||||
pub required: bool,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1977,7 +1977,7 @@ fn extract_ignore_unknown_stuff_roundtrip() {
|
|||
#[derive(FromXml, AsXml, PartialEq, Debug, Clone)]
|
||||
#[xml(namespace = NS1, name = "foo")]
|
||||
struct Flag {
|
||||
#[xml(flag(namespace = NS1, name = "flag"))]
|
||||
#[xml(flag)]
|
||||
flag: bool,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue