parsers: replace generate_empty_element with derive
This commit is contained in:
parent
0adfd1218b
commit
bc785fde28
14 changed files with 122 additions and 150 deletions
|
|
@ -4,17 +4,18 @@
|
|||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
use crate::iq::{IqGetPayload, IqResultPayload};
|
||||
use xso::{FromXml, IntoXml};
|
||||
|
||||
generate_empty_element!(
|
||||
/// Represents a query for the software version a remote entity is using.
|
||||
///
|
||||
/// It should only be used in an `<iq type='get'/>`, as it can only
|
||||
/// represent the request, and not a result.
|
||||
VersionQuery,
|
||||
"query",
|
||||
VERSION
|
||||
);
|
||||
use crate::iq::{IqGetPayload, IqResultPayload};
|
||||
use crate::ns;
|
||||
|
||||
/// Represents a query for the software version a remote entity is using.
|
||||
///
|
||||
/// It should only be used in an `<iq type='get'/>`, as it can only
|
||||
/// represent the request, and not a result.
|
||||
#[derive(FromXml, IntoXml, PartialEq, Debug, Clone)]
|
||||
#[xml(namespace = ns::VERSION, name = "query")]
|
||||
pub struct VersionQuery;
|
||||
|
||||
impl IqGetPayload for VersionQuery {}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue