Skip to content

Export macro test_vfs #18

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

Closed
der-b opened this issue Mar 13, 2021 · 7 comments
Closed

Export macro test_vfs #18

der-b opened this issue Mar 13, 2021 · 7 comments

Comments

@der-b
Copy link

der-b commented Mar 13, 2021

If the vfs is extended by in another crate as suggested here, than the macro test_vfs! can't be used from the other crate, since it is only available for the tests. It would be nice, if this macro can be exported for the use within other crates. My be it can be exported as a feature?

At least, I didn't found any possibility to access the macro from an other crate.

@manuel-woelker
Copy link
Owner

Good point, thanks for the suggestion. It should be possible to export this with a feature gate. I will take a look at this tomorrow.

@manuel-woelker
Copy link
Owner

Should work now in 0.5.1, please let me know if there are any issues. Cheers!

@der-b
Copy link
Author

der-b commented Mar 14, 2021

Thanks, but there is still an issue: The macro tries to import VfsPath and VfsFileType from the current crate. Obviously, these are only available in VFS and not in other crates. I don't have an idea, how to solve this. Maybe the caller has to import these types?

@manuel-woelker
Copy link
Owner

Could you try with ad1c22e, I changed the use declaration to use $crate, which might fix the issue.

https://doc.rust-lang.org/reference/macros-by-example.html#hygiene

@der-b
Copy link
Author

der-b commented Mar 15, 2021

Great! Now it works!
Thanks.

@der-b der-b closed this as completed Mar 15, 2021
@manuel-woelker
Copy link
Owner

Good to hear! Do you want me to publish another patch version so you don't have to depend on a git commit id?

@der-b
Copy link
Author

der-b commented Mar 18, 2021

Yes, that would be great.

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