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

Workaround for macro imports in one_ofs is unnecessary #6

Open
Sushisource opened this issue Jan 10, 2022 · 1 comment
Open

Workaround for macro imports in one_ofs is unnecessary #6

Sushisource opened this issue Jan 10, 2022 · 1 comment

Comments

@Sushisource
Copy link

The readme currently recommends manually adding use statements for oneofs with

   .type_attribute(
            ".my.pkg.SomeOne.body",
            "use serde::{Serialize,Deserialize}; #[derive(Serialize,Deserialize)]"
        )

This obviously is a huge pain if you have a lot of oneofs. Luckily it's also totally unnecessary.

Simply changing:

  .type_attribute(
            ".",
            "#[derive(Serialize,Deserialize)]"
        )

To

  .type_attribute(
            ".",
            "#[derive(::serde::Serialize, ::serde::Deserialize)]"
        )

Is a much easier fix

@fdeantoni
Copy link
Owner

Thanks for raising this issue! This would make things a lot simpler. I can't remember exactly why I documented it this way, but I will have to check (might be it was due to the way macros imports were handled before but not sure anymore)...

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