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

unused borrow that must be used #9

Closed mahkoh closed 3 years ago

mahkoh commented 3 years ago
warning: unused borrow that must be used
   --> /home/julian/.cargo/registry/src/github.com-1ecc6299db9ec823/nameof-1.2.1/src/lib.rs:86:13
    |
82  | / macro_rules! name_of {
83  | |     // Covers Bindings
84  | |     ($n: ident) => {{
85  | |         let _ = || {
86  | |             &$n;
    | |             ^^^ the borrow produces a value
...   |
110 | |     }};
111 | | }
    | |_- in this expansion of `name_of!`
    |
   ::: src/keyboard.rs:202:45
    |
202 |                   debug_tuple = f.debug_tuple(name_of!(XkbSym));
    |                                               ---------------- in this macro invocation
SilentByte commented 3 years ago

I just merged a PR by @EnoughTea (https://github.com/SilentByte/nameof/pull/8) that addresses this and published a new version. This should be fixed now.