aboutsummaryrefslogtreecommitdiff
path: root/macros/src/fn_trait.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-01-30 21:29:21 +0100
committerHampusM <hampus@hampusmat.com>2023-01-30 21:29:21 +0100
commit178267c701c233542078c09fe6b19802f9642dbd (patch)
tree3d3010806f6509c062ca86dbbbe9c3a6cd2fe547 /macros/src/fn_trait.rs
parent17ca46e95af38a914197958bbcc1e759865b6005 (diff)
feat: improve macro error messages
Diffstat (limited to 'macros/src/fn_trait.rs')
-rw-r--r--macros/src/fn_trait.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/macros/src/fn_trait.rs b/macros/src/fn_trait.rs
index d88d391..31d7d95 100644
--- a/macros/src/fn_trait.rs
+++ b/macros/src/fn_trait.rs
@@ -2,7 +2,7 @@ use quote::ToTokens;
use syn::parse::Parse;
use syn::punctuated::Punctuated;
use syn::token::Paren;
-use syn::{parenthesized, parse_str, Ident, Token, TraitBound, Type};
+use syn::{parenthesized, Ident, Token, TraitBound, Type};
/// A function trait. `dyn Fn(u32) -> String`
#[derive(Debug, Clone, PartialEq, Eq)]
@@ -76,7 +76,7 @@ impl ToTokens for FnTrait
self.output.to_tokens(tokens);
if !self.trait_bounds.is_empty() {
- let plus: Token![+] = parse_str("+").unwrap();
+ let plus = <Token![+]>::default();
plus.to_tokens(tokens);