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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
That's a good observation.
ident
is a type from thesyn
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 onident
isn't the sameto_string()
method on a string slice. It's necessary to call it in order to work with the underlying string representation of the identifier.