Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change proc-macro-error dependency to proc-macro-error2 in macros #545

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ proc-macro = true
[dependencies]
mime = "0.3"
proc-macro2 = "1.0"
proc-macro-error = "1.0"
proc-macro-error2 = "2.0.1"
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
heck = { version = "0.4", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions macros/src/actix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use heck::*;
use http::StatusCode;
use lazy_static::lazy_static;
use proc_macro::TokenStream;
use proc_macro_error::ResultExt;
use quote::{quote, ToTokens};
use strum_macros::EnumString;
use syn::{
Expand Down Expand Up @@ -769,7 +768,9 @@ fn field_extract_f32(nv: MetaNameValue) -> Option<proc_macro2::TokenStream> {
},
Lit::Float(f) => Ok(quote! { #f }),
Lit::Int(i) => {
let f: f32 = i.base10_parse().unwrap_or_abort();
let f: f32 = i
.base10_parse()
.unwrap_or_else(|e| abort!(i.span(), "{}", e));
Ok(quote! { #f })
}
_ => {
Expand Down
2 changes: 1 addition & 1 deletion macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

extern crate proc_macro;
#[macro_use]
extern crate proc_macro_error;
extern crate proc_macro_error2;

#[cfg(feature = "actix")]
#[macro_use]
Expand Down
Loading