You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: make it easier to write shared code interfacing shadow's output.
Currently, shadow only generates pub const VAR: &str variables - it's great as is, but is also quite a bit unwieldy, leading to a lot of boilerplate in multi-binary projects.
There are two main benefits to this approach:
easier manipulation and code decoupling - if I want to write display methods, I could have functions accepting a reference to that struct
API documentation is easier - just look up said structure
This also ties into what @epage wrote in #75 (comment) - such a struct would work as an accessor. Or rather, structs, as it would be then split per-source (git, rust, etc).
In my project I have a struct (not using all variables), which could easily be made as a part of code generation, like this:
TL;DR: make it easier to write shared code interfacing
shadow
's output.Currently,
shadow
only generatespub const VAR: &str
variables - it's great as is, but is also quite a bit unwieldy, leading to a lot of boilerplate in multi-binary projects.There are two main benefits to this approach:
This also ties into what @epage wrote in #75 (comment) - such a struct would work as an accessor. Or rather, structs, as it would be then split per-source (git, rust, etc).
In my project I have a struct (not using all variables), which could easily be made as a part of code generation, like this:
which is then initialized with:
The text was updated successfully, but these errors were encountered: