Skip to content

Commit

Permalink
let's just go with this
Browse files Browse the repository at this point in the history
no it's not optimal but I need to go
  • Loading branch information
ArthurZucker committed Jun 16, 2024
1 parent e53f4ca commit 18238dd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tokenizers/display_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn generate_fmt_impl_for_struct(
attrs: &Option<FmtAttribute>,
) -> proc_macro2::TokenStream {
let fields = &data_struct.fields;

// TODO I am stuck here for now hehe.
// Basically we need to produce the body that will be used.
// Generate field formatting expressions
let field_formats: Vec<_> = fields
.iter()
Expand Down Expand Up @@ -85,13 +86,9 @@ fn generate_fmt_impl_for_struct(

// Generate the final implementation of Display trait for the struct
quote! {

Check failure on line 88 in tokenizers/display_derive/src/lib.rs

View workflow job for this annotation

GitHub Actions / Check everything builds & tests (ubuntu-latest)

the trait bound `Vec<TokenStream2>: ToTokens` is not satisfied

Check failure on line 88 in tokenizers/display_derive/src/lib.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.8)

the trait bound `Vec<TokenStream2>: ToTokens` is not satisfied

Check failure on line 88 in tokenizers/display_derive/src/lib.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.10)

the trait bound `Vec<TokenStream2>: ToTokens` is not satisfied

Check failure on line 88 in tokenizers/display_derive/src/lib.rs

View workflow job for this annotation

GitHub Actions / Check it builds for Windows 32-bit (3.7)

the trait bound `Vec<TokenStream2>: ToTokens` is not satisfied
impl std::fmt::Display for #ident {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(f, "{}(", stringify!(#ident))?;
#(#field_formats)*
write!(f, ")")
}
}
write!(f, "{}(", stringify!(#ident))?;
#field_formats
write!(f, ")")
}
}
fn generate_fmt_impl_for_enum(
Expand Down

0 comments on commit 18238dd

Please sign in to comment.