fdeantoni/prost-wkt

Workaround for macro imports in one_ofs is unnecessary

Opened this issue · 1 comments

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

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)...