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

unused_import warning for rstest_reuse templates exported and only used by other crates #176

Closed
mauricelam opened this issue Jan 13, 2023 · 1 comment

Comments

@mauricelam
Copy link

The following code causes unused_import warning:

mod template_module {

    use rstest_reuse::template;

    #[template]
    #[export]
    #[rstest]
    fn my_test_function() {
    }
    
}
warning: unused import: `my_test_function`
  --> src/main.rs:14:8
   |
14 |     fn my_test_function() {
   |        ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Since I am exporting the template for another crate to use, I am not using it within my own crate. But even if there are usages from other dependent crates, this causes the above warning, which I think is caused by pub(crate) use #macro_name generated by rstest_reuse.

rustexplorer

@la10736
Copy link
Owner

la10736 commented Jan 13, 2023

Right,
I'll try to fix it ASAP by add #[allow(unused_imports)]

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

2 participants