tower-web
tower-web copied to clipboard
2018 edition of Rust requires a bunch of imports
To use impl_web! in rust-2018 requires typing in this monstrocity:
use tower_web::{
derive_resource, derive_resource_impl, impl_web, impl_web_clean_nested,
impl_web_clean_top_level,
};
Is there perhaps a cleaner way?
@dtolnay how is Serde handling similar issues?
We use https://github.com/rust-lang/rust/pull/51496.
I've managed to use the #[macro_export(local_inner_macros)] to make it possible in the 2018 edition to import only:
use tower_web::{derive_resource_impl, impl_web};
It still requires the derive_resource_impl to be imported, sadly that's where my skills fall short.
You may see the changes here, but it would be nice to be able to import only impl_web or drop it as a whole as the #194 issue
https://github.com/elpiel/tower-web/compare/edition-2018...elpiel:macro-fixes-for-2018-edition?expand=1
Thanks @elpiel!