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

Replace #[macro_use] with normal use #805

Closed
luleyleo opened this issue Apr 6, 2020 · 1 comment · Fixed by #808
Closed

Replace #[macro_use] with normal use #805

luleyleo opened this issue Apr 6, 2020 · 1 comment · Fixed by #808
Labels
D-Easy just needs to be implemented maintenance cleans up code or docs

Comments

@luleyleo
Copy link
Collaborator

luleyleo commented Apr 6, 2020

druid-shell/src/lib.rs#L27

#[cfg(target_os = "windows")]
#[macro_use]
extern crate winapi;

#[cfg(all(target_os = "macos", not(feature = "use_gtk")))]
#[macro_use]
extern crate objc;

#[cfg(not(any(feature = "use_gtk", target_os = "linux")))]
#[macro_use]
extern crate lazy_static;

#[cfg(all(target_os = "linux", feature = "x11"))]
#[macro_use]
extern crate lazy_static;

This is no longer necessary with Rust2018 and should be replaced with use statements in modules that actually utilize those macros

@luleyleo luleyleo added D-Easy just needs to be implemented maintenance cleans up code or docs labels Apr 6, 2020
@totsteps
Copy link
Collaborator

totsteps commented Apr 6, 2020

@Finnerale would love to fix this.
I know the very basics of rust. But here's how I will approach this. Please correct me if I am wrong.

  1. Remove all use of #[macro_use] from druid-shell/lib.rs file.
  2. Import macros using use.
    For example, in platform/mac/application.rs file I need to add the following line
    use objc::{class, msg_send, sel, sel_impl};.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-Easy just needs to be implemented maintenance cleans up code or docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants