SilentByte / nameof

Provides a Rust macro to determine the string name of a binding, type, or function.
https://crates.io/crates/nameof
MIT License
37 stars 3 forks source link

Support `Self` or suppress `clippy::use_self` warning #10

Open mxk opened 1 year ago

mxk commented 1 year ago

It's currently not possible to use name_of_type!(Self) to get the actual type name. If there is a way to support this, that would be great, but until then, it would be nice to automatically suppress clippy::use_self warning in the macro.

MingweiSamuel commented 2 weeks ago

stringify!(Self) will always return Self - instead you may be able to use std::any::type_name::<Self>()