mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
xso-proc: Fix all clippy warnings
This commit is contained in:
parent
b18385cfff
commit
4356cab33c
5 changed files with 8 additions and 11 deletions
|
@ -97,7 +97,7 @@ impl Compound {
|
||||||
for field in self.fields.iter() {
|
for field in self.fields.iter() {
|
||||||
let member = field.member();
|
let member = field.member();
|
||||||
let builder_field_name = mangle_member(member);
|
let builder_field_name = mangle_member(member);
|
||||||
let part = field.make_builder_part(&scope, &output_name)?;
|
let part = field.make_builder_part(&scope, output_name)?;
|
||||||
|
|
||||||
match part {
|
match part {
|
||||||
FieldBuilderPart::Init {
|
FieldBuilderPart::Init {
|
||||||
|
@ -174,7 +174,7 @@ impl Compound {
|
||||||
|
|
||||||
states.push(State::new_with_builder(
|
states.push(State::new_with_builder(
|
||||||
default_state_ident.clone(),
|
default_state_ident.clone(),
|
||||||
&builder_data_ident,
|
builder_data_ident,
|
||||||
&builder_data_ty,
|
&builder_data_ty,
|
||||||
).with_impl(quote! {
|
).with_impl(quote! {
|
||||||
match ev {
|
match ev {
|
||||||
|
|
|
@ -75,7 +75,7 @@ impl fmt::Display for FieldName<'_> {
|
||||||
pub(super) fn on_missing_attribute(parent_name: &ParentRef, field: &Member) -> String {
|
pub(super) fn on_missing_attribute(parent_name: &ParentRef, field: &Member) -> String {
|
||||||
format!(
|
format!(
|
||||||
"Required attribute {} on {} missing.",
|
"Required attribute {} on {} missing.",
|
||||||
FieldName(&field),
|
FieldName(field),
|
||||||
parent_name
|
parent_name
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,9 +350,6 @@ impl FieldDef {
|
||||||
|
|
||||||
/// Return true if this field's parsing consumes text data.
|
/// Return true if this field's parsing consumes text data.
|
||||||
pub(crate) fn is_text_field(&self) -> bool {
|
pub(crate) fn is_text_field(&self) -> bool {
|
||||||
match self.kind {
|
matches!(self.kind, FieldKind::Text { .. })
|
||||||
FieldKind::Text { .. } => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ use syn::{meta::ParseNestedMeta, spanned::Spanned, *};
|
||||||
use rxml_validation::NcName;
|
use rxml_validation::NcName;
|
||||||
|
|
||||||
/// XML core namespace URI (for the `xml:` prefix)
|
/// XML core namespace URI (for the `xml:` prefix)
|
||||||
pub const XMLNS_XML: &'static str = "http://www.w3.org/XML/1998/namespace";
|
pub const XMLNS_XML: &str = "http://www.w3.org/XML/1998/namespace";
|
||||||
/// XML namespace URI (for the `xmlns:` prefix)
|
/// XML namespace URI (for the `xmlns:` prefix)
|
||||||
pub const XMLNS_XMLNS: &'static str = "http://www.w3.org/2000/xmlns/";
|
pub const XMLNS_XMLNS: &str = "http://www.w3.org/2000/xmlns/";
|
||||||
|
|
||||||
/// Value for the `#[xml(namespace = ..)]` attribute.
|
/// Value for the `#[xml(namespace = ..)]` attribute.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -118,7 +118,7 @@ impl StructDef {
|
||||||
.compile()
|
.compile()
|
||||||
.render(
|
.render(
|
||||||
vis,
|
vis,
|
||||||
&builder_ty_ident,
|
builder_ty_ident,
|
||||||
&state_ty_ident,
|
&state_ty_ident,
|
||||||
&TypePath {
|
&TypePath {
|
||||||
qself: None,
|
qself: None,
|
||||||
|
@ -165,7 +165,7 @@ impl StructDef {
|
||||||
}
|
}
|
||||||
.into(),
|
.into(),
|
||||||
&state_ty_ident,
|
&state_ty_ident,
|
||||||
&event_iter_ty_ident,
|
event_iter_ty_ident,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(IntoXmlParts {
|
Ok(IntoXmlParts {
|
||||||
|
|
Loading…
Reference in a new issue