Skip to content

Commit

Permalink
blindly fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Jun 12, 2024
1 parent 4c3f37a commit 292475f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion tokenizers/display_derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
syn = "1.0"
quote = "1.0"
proc-macro2 = "1.0"
unicode-xid = "0.2.4"

[lib]
proc-macro = true
10 changes: 4 additions & 6 deletions tokenizers/display_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ use vendored::FmtAttribute;
pub fn display_derive(input: TokenStream) -> TokenStream {
// Parse the input tokens into a syntax tree
let input = parse_macro_input!(input as DeriveInput);

return ;
let attr_name = "display";
let attrs = FmtAttributes::parse_attrs(&input.attrs, &attr_name)?
.map(Spanning::into_inner)
let attrs = FmtAttribute::parse_attrs(&input.attrs, &attr_name)?
.unwrap_or_default();
let trait_ident = format_ident!("display");
let ident = &input.ident;
Expand Down Expand Up @@ -92,8 +91,7 @@ fn expand_enum(
let match_arms = e.variants.iter().try_fold(
(Vec::new(), TokenStream::new()),
|mut arms, variant| {
let attrs = ContainerAttributes::parse_attrs(&variant.attrs, attr_name)?
.map(Spanning::into_inner)
let attrs = FmtAttribute::parse_attrs(&variant.attrs, attr_name)?
.unwrap_or_default();
let ident = &variant.ident;

Expand Down Expand Up @@ -214,7 +212,7 @@ impl<'a> Expansion<'a> {
format!(
"TODO ARTHUR! struct or enum variant with more than 1 field must have \
`#[{}(\"...\", ...)]` attribute",
trait_name_to_attribute_name(self.trait_ident),
self.trait_ident,
),
)),
}
Expand Down
2 changes: 1 addition & 1 deletion tokenizers/display_derive/src/parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::iter;

use unicode_xid::UnicodeXID as XID;
// use unicode_xid::UnicodeXID as XID;

/// Output of the [`format_string`] parser.
#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down

0 comments on commit 292475f

Please sign in to comment.