Skip to content

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Scherer committed Jun 26, 2020
1 parent 196ed41 commit 2caa306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,13 @@ pub fn one(input: TokenStream) -> TokenStream {
.into()
}

fn split_for_impl(generics: &syn::Generics) -> (syn::ImplGenerics, syn::TypeGenerics, impl quote::ToTokens) {
fn split_for_impl(
generics: &syn::Generics,
) -> (syn::ImplGenerics, syn::TypeGenerics, impl quote::ToTokens) {
let (impl_, type_, where_) = generics.split_for_impl();
let where_ = match where_ {
Some(where_) => quote!{ #where_, },
None => quote!{ where },
Some(where_) => quote! { #where_, },
None => quote! { where },
};
(impl_, type_, where_)
}
Expand Down
4 changes: 3 additions & 1 deletion tests/generic_newtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ use std::ops::Neg;
Num,
Float,
)]
struct MyThing<T: Cake>(T) where T: Lie;
struct MyThing<T: Cake>(T)
where
T: Lie;

trait Cake {}
trait Lie {}
Expand Down

0 comments on commit 2caa306

Please sign in to comment.