Skip to content
New issue

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

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

Already on GitHub? # 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)...

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

No branches or pull requests

2 participants