Move use_self_macro into crashes/auxiliary

This commit is contained in:
Yuki Okushi 2020-01-03 17:03:07 +09:00
parent bf67fcf5a9
commit c6aeda7bd5
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
macro_rules! use_self {
(
impl $ty:ident {
fn func(&$this:ident) {
[fields($($field:ident)*)]
}
}
) => (
impl $ty {
fn func(&$this) {
let $ty { $($field),* } = $this;
}
}
)
}

View File

@ -1,7 +1,7 @@
#![warn(clippy::use_self)]
#[macro_use]
#[path = "../auxiliary/use_self_macro.rs"]
#[path = "auxiliary/use_self_macro.rs"]
mod use_self_macro;
struct Foo {