Skip to content

Commit

Permalink
fix: switch from proc-macro-error to proc-macro-error2 fork in macros (
Browse files Browse the repository at this point in the history
…#545)

Move to a fork of proc-macro-error since the original is unmaintained
  • Loading branch information
thomedw authored Oct 3, 2024
1 parent fb9e596 commit 04a0be0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
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

0 comments on commit 04a0be0

Please sign in to comment.