Skip to content

Commit

Permalink
refactor: bump to syn 2.0 (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
molpopgen committed Sep 6, 2024
1 parent 00e2367 commit 946b8d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
27 changes: 8 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tskit-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ homepage = "https://github.com/tskit-dev/tskit-rust"
proc-macro = true

[dependencies]
syn = { version = "1.0", features = ["derive"] }
syn = { version = "2.0", features = ["derive"] }
quote = "1.0"
proc-macro-error2 = "2.0"
4 changes: 2 additions & 2 deletions tskit-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn impl_metadata_roundtrip_macro(ast: &syn::DeriveInput) -> Result<TokenStream,
let attrs = &ast.attrs;

for attr in attrs.iter() {
if attr.path.is_ident("serializer") {
if attr.path().is_ident("serializer") {
let lit: syn::LitStr = attr.parse_args().unwrap();
let serializer = lit.value();

Expand All @@ -67,7 +67,7 @@ fn impl_metadata_roundtrip_macro(ast: &syn::DeriveInput) -> Result<TokenStream,
proc_macro_error2::abort!(serializer, "is not a supported protocol.");
}
} else {
proc_macro_error2::abort!(attr.path, "is not a supported attribute.");
proc_macro_error2::abort!(attr.path(), "is not a supported attribute.");
}
}

Expand Down

0 comments on commit 946b8d6

Please sign in to comment.