Skip to content

Commit

Permalink
Format PR 1791 with rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 10, 2020
1 parent 1fe3904 commit 548eb8f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions serde_derive/src/internals/attr.rs
Expand Up @@ -594,12 +594,11 @@ impl Container {
}

use proc_macro2::Delimiter;
let is_packed = item.attrs.iter().any(|attr| {
match attr.style {
syn::AttrStyle::Outer => attr
.path
.get_ident()
.map_or(false, |ident| *ident == "repr")
let is_packed = item.attrs.iter().any(|attr| match attr.style {
syn::AttrStyle::Outer => {
attr.path
.get_ident()
.map_or(false, |ident| *ident == "repr")
&& syn::parse2::<Group>(attr.tokens.clone())
.ok()
.filter(|g| g.delimiter() == Delimiter::Parenthesis)
Expand All @@ -609,9 +608,9 @@ impl Container {
repr == "packed"
|| repr.starts_with("packed(")
|| repr.starts_with("packed ")
}),
_ => false
})
}
_ => false,
});

Container {
Expand Down

0 comments on commit 548eb8f

Please sign in to comment.