#mod #import #dynamic #use #proc-macro

macro proc_use_inline

A different syntax for mod and use

1 unstable release

0.1.1 Jun 7, 2020

#8 in #use

GPL-3.0+

11KB
237 lines

proc_use_inline

proc_use_inline is a Rust crate offering an alternate syntax for mod and use statements. Take the following Rust code:

mod foo;
use foo::*;

use itertools::*;

#[path = "../other/ext.rs"]
mod ext;

This literally translates into:

proc_macro_inline::proc_macro_inline! {
	#[mod]
	use foo::*;
	
	use itertools::*;
	
	mod("../other/ext.rs");
}

lib.rs:

proc_use_inline

proc_use_inline is a library for semi-dynamically importing creates/modules.

The proc_use_inline is a macro to generate use and mod statements.

See the proc_use website for additional documentation and usage examples.

Dependencies

~1.5MB
~34K SLoC