Use quote::format_ident!

This commit is contained in:
Jonas Platte 2019-12-13 20:42:20 +01:00
parent 9f463bb726
commit 370c56ef31
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -1,7 +1,7 @@
//! Details of generating code for the `ruma_event` procedural macro.
use proc_macro2::{Span, TokenStream};
use quote::{quote, quote_spanned, ToTokens};
use quote::{format_ident, quote, quote_spanned, ToTokens};
use syn::{
parse::{self, Parse, ParseStream},
parse_quote,
@ -44,7 +44,7 @@ impl From<RumaEventInput> for RumaEvent {
fn from(input: RumaEventInput) -> Self {
let kind = input.kind;
let name = input.name;
let content_name = Ident::new(&format!("{}Content", &name), Span::call_site());
let content_name = format_ident!("{}Content", name, span = Span::call_site());
let event_type = input.event_type;
let is_custom = is_custom_event_type(&event_type);