Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018 edition of Rust requires a bunch of imports #77

Open
berkus opened this issue Aug 23, 2018 · 4 comments
Open

2018 edition of Rust requires a bunch of imports #77

berkus opened this issue Aug 23, 2018 · 4 comments

Comments

@berkus
Copy link

berkus commented Aug 23, 2018

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?

@shepmaster
Copy link
Collaborator

@dtolnay how is Serde handling similar issues?

@shepmaster shepmaster changed the title 2018 edition of rust requires a bunch of imports 2018 edition of Rust requires a bunch of imports Aug 23, 2018
@dtolnay
Copy link
Contributor

dtolnay commented Aug 23, 2018

We use rust-lang/rust#51496.

@elpiel
Copy link
Contributor

elpiel commented May 8, 2019

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

@berkus
Copy link
Author

berkus commented May 10, 2019

Thanks @elpiel!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants