DEV Community

Discussion on: Some Learnings from Implementing a Normalizing Rust Representer

Collapse
 
seanchen1991 profile image
Sean Chen

That's a good observation. ident is a type from the syn crate that, from what I can tell, is a wrapper around a String: docs.rs/syn/1.0.35/syn/struct.Iden...

So in this case, the to_string() method on ident isn't the same to_string() method on a string slice. It's necessary to call it in order to work with the underlying string representation of the identifier.