This commit is contained in:
nora 2022-09-13 22:23:12 +02:00
parent 271046694a
commit 2f7a13cb2f
3 changed files with 59 additions and 83 deletions

View file

@ -130,9 +130,9 @@ where
impl ToTokens for Alignment {
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
tokens.extend(match self {
Self::Center => quote! { WithCenterAlign },
Self::Left => quote! { WithLeftAlign },
Self::Right => quote! { WithRightAlign },
Self::Left => quote! { 1 },
Self::Center => quote! { 2 },
Self::Right => quote! { 3 },
})
}
}
@ -154,7 +154,7 @@ impl ToTokens for FmtPart {
opt_toks = quote! { #crate_ident::_private::WithFill<#opt_toks, #fill> };
}
let alignment = align.kind;
opt_toks = quote! { #crate_ident::_private::#alignment<#opt_toks> };
opt_toks = quote! { #crate_ident::_private::WithAlign<#opt_toks, #alignment> };
}
if spec.alternate {