diff --git a/xso-proc/src/compound.rs b/xso-proc/src/compound.rs index a37836f5d5918b5320371684c8227f348d6e5ccb..53502ffb8a51fae1653924e166b9ef4b27705a91 100644 --- a/xso-proc/src/compound.rs +++ b/xso-proc/src/compound.rs @@ -312,7 +312,7 @@ impl Compound { states.push(State::new_with_builder( state_name.clone(), - &builder_data_ident, + builder_data_ident, &builder_data_ty, ).with_field( substate_data, @@ -457,7 +457,7 @@ impl Compound { states.push(State::new_with_builder( discard_state_ident.clone(), - &builder_data_ident, + builder_data_ident, &builder_data_ty, ).with_field( substate_data, @@ -726,7 +726,7 @@ impl Compound { if self.fields.len() > 1 { return None; } - self.fields.get(0).map(|x| x.ty()) + self.fields.first().map(|x| x.ty()) } /// Construct a tuple type with this compound's field's types in the same diff --git a/xso-proc/src/enums.rs b/xso-proc/src/enums.rs index 6ad8b6f7ead5cd9bebf898072ef091f8f6ab37b7..2638cb57b7228f6b68e2a7aa1fbba7d789a2717c 100644 --- a/xso-proc/src/enums.rs +++ b/xso-proc/src/enums.rs @@ -136,7 +136,7 @@ impl NameVariant { }), state_ty_ident, &self.ident.to_string(), - &item_iter_ty_lifetime, + item_iter_ty_lifetime, )? .with_augmented_init(|init| { quote! { diff --git a/xso-proc/src/error_message.rs b/xso-proc/src/error_message.rs index da1cd72e9291621769f0aa12862b08846eea09fd..db70ab7a7abc7f8a13c13c8691938469f0451f02 100644 --- a/xso-proc/src/error_message.rs +++ b/xso-proc/src/error_message.rs @@ -130,7 +130,7 @@ pub(super) fn on_missing_attribute(parent_name: &ParentRef, field: &Member) -> S /// `parent_name` should point at the compound which is being parsed and /// `field` should be the field to which the child belongs. pub(super) fn on_missing_child(parent_name: &ParentRef, field: &Member) -> String { - format!("Missing child {} in {}.", FieldName(&field), parent_name) + format!("Missing child {} in {}.", FieldName(field), parent_name) } /// Create a string error message for a duplicate child element. @@ -141,6 +141,6 @@ pub(super) fn on_duplicate_child(parent_name: &ParentRef, field: &Member) -> Str format!( "{} must not have more than one child in {}.", parent_name, - FieldName(&field) + FieldName(field) ) } diff --git a/xso-proc/src/field/flag.rs b/xso-proc/src/field/flag.rs index 4e1789be378134d9dd9f4ebbae8e05faa16ee572..59b7cf49e7660d8e2269fc8a84a752829dcb4848 100644 --- a/xso-proc/src/field/flag.rs +++ b/xso-proc/src/field/flag.rs @@ -40,17 +40,17 @@ impl Field for FlagField { let unknown_attr_err = format!( "Unknown attribute in flag child {} in {}.", - FieldName(&member), + FieldName(member), container_name ); let unknown_child_err = format!( "Unknown child in flag child {} in {}.", - FieldName(&member), + FieldName(member), container_name ); let unknown_text_err = format!( "Unexpected text in flag child {} in {}.", - FieldName(&member), + FieldName(member), container_name ); diff --git a/xso-proc/src/field/mod.rs b/xso-proc/src/field/mod.rs index 0f80e56184ef2751260fd9fd6ff85623530c45ea..d345dd1089220d9ef3681ab918bf62a5f9273b06 100644 --- a/xso-proc/src/field/mod.rs +++ b/xso-proc/src/field/mod.rs @@ -420,8 +420,13 @@ fn new_field( })), #[cfg(not(feature = "minidom"))] - XmlFieldMeta::Element { span, amount } => { + XmlFieldMeta::Element { + span, + amount, + default_, + } => { let _ = amount; + let _ = default_; Err(Error::new( span, "#[xml(element)] requires xso to be built with the \"minidom\" feature.", diff --git a/xso-proc/src/meta.rs b/xso-proc/src/meta.rs index 50dfb6a86bd68a7e854232c0799b2fba6bc7efb2..9ac7fab3b0a2bc338f1f6c778dcd14168ae6bbc0 100644 --- a/xso-proc/src/meta.rs +++ b/xso-proc/src/meta.rs @@ -695,16 +695,11 @@ fn parse_codec_expr(p: parse::ParseStream<'_>) -> Result<(Expr, Option)> // We got a type path -- so we now inject the `::` before any `<` as // needed. for segment in type_path.path.segments.iter_mut() { - match segment.arguments { - PathArguments::AngleBracketed(ref mut arguments) => { - let span = arguments.span(); - arguments - .colon2_token - .get_or_insert_with(|| token::PathSep { - spans: [span, span], - }); - } - _ => (), + if let PathArguments::AngleBracketed(ref mut arguments) = segment.arguments { + let span = arguments.span(); + arguments.colon2_token.get_or_insert(token::PathSep { + spans: [span, span], + }); } } Ok(( diff --git a/xso-proc/src/types.rs b/xso-proc/src/types.rs index 938f84884d793b8bf856a5090cb2bdee2bd9b9d4..c4cf18cd9561c54e29cf3f2783a06706fd6f80b6 100644 --- a/xso-proc/src/types.rs +++ b/xso-proc/src/types.rs @@ -358,7 +358,7 @@ pub(crate) fn text_codec_encode_fn(for_ty: Type) -> Expr { Expr::Path(ExprPath { attrs: Vec::new(), qself: None, - path: path, + path, }) } @@ -373,7 +373,7 @@ pub(crate) fn text_codec_decode_fn(for_ty: Type) -> Expr { Expr::Path(ExprPath { attrs: Vec::new(), qself: None, - path: path, + path, }) }