refactor: fix fmt and clippy based on contributions

This commit is contained in:
Marc-Antoine Arnaud 2024-01-03 17:44:53 +01:00
parent 6f434c84cd
commit 0578b73c8a
2 changed files with 7 additions and 7 deletions

View File

@ -1087,12 +1087,12 @@ fn de_attribute_sequence() {
#[test]
fn de_nested_macro_rules() {
init!();
init();
macro_rules! float_attrs {
($type:ty) => {
#[derive(Default, PartialEq, Debug, YaDeserialize)]
pub struct Outer{
pub struct Outer {
#[yaserde(attribute)]
pub inner: Option<$type>,
}
@ -1100,4 +1100,4 @@ fn de_nested_macro_rules() {
}
float_attrs!(f32);
}
}

View File

@ -253,17 +253,17 @@ impl From<&syn::PathSegment> for Field {
match args.args.first() {
Some(syn::GenericArgument::Type(Path(ref path))) => {
return Field::from(&path.path);
},
Some(syn::GenericArgument::Type(syn::Type::Group(syn::TypeGroup { elem, ..}))) => {
}
Some(syn::GenericArgument::Type(syn::Type::Group(syn::TypeGroup { elem, .. }))) => {
if let syn::Type::Path(ref group) = elem.as_ref() {
return Field::from(&group.path);
}
},
}
_ => unimplemented!("unable to match '{:?}'", args.args.first()),
}
}
unimplemented!("unable to match '{}'", quote!{#path_segment})
unimplemented!("unable to match '{}'", quote! {#path_segment})
}
}