#syntax #debugging #impl

macro as-method

Call function using the method syntax!

1 unstable release

0.1.0 Jan 30, 2024

#1105 in Procedural macros

MIT license

6KB
95 lines

as-method

Call function using the method syntax!

Example

mod a {
    use as_method::as_method;

    #[as_method]
    pub fn foo<T: std::fmt::Debug>(x: impl std::fmt::Debug, y: T) {
        println!("{x:?}, {y:?}");
    }
}

use a::foo;

fn main() {
    1.foo(2);
}

Dependencies

~275–720KB
~17K SLoC