Skip to content

how to create an ident from a string #546

Closed
@softprops

Description

@softprops

I'm in the process of a crate from 0.11 => 0.15.22 ( the latest as of today ) and am trying to figure out what the equivalent of 0.11's From impl for strs is in the latest release. Ident::from(format!("{}Key", name)) . There is a new method but requires proc_macro2 for Span::call_site() however this Span comes from the proc_macro2 crate which I haven't needed to depend on yet. I see that the rust proper proc_macro crate has a stable version of that here

Is there a way to construct an Ident in the latest syn without pulling in the proc_macro2 crate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions