Skip to content

Commit

Permalink
Run cargo fmt, it seems to have some new rules (#272)
Browse files Browse the repository at this point in the history
CI was failing on all PRs
  • Loading branch information
JelteF committed Jul 3, 2023
1 parent 37cae22 commit 2e3ddc2
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions impl/src/fmt/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,16 @@ impl<'a> Expansion<'a> {
/// Generates trait bounds for a struct or an enum variant.
fn generate_bounds(&self) -> Vec<syn::WherePredicate> {
let Some(fmt) = &self.attrs.fmt else {
return self.fields.iter().next().map(|f| {
let ty = &f.ty;
let trait_ident = &self.trait_ident;
vec![parse_quote! { #ty: ::core::fmt::#trait_ident }]
})
.unwrap_or_default();
return self
.fields
.iter()
.next()
.map(|f| {
let ty = &f.ty;
let trait_ident = &self.trait_ident;
vec![parse_quote! { #ty: ::core::fmt::#trait_ident }]
})
.unwrap_or_default();
};

fmt.bounded_types(self.fields)
Expand Down

0 comments on commit 2e3ddc2

Please sign in to comment.