cargo-bundle
cargo-bundle copied to clipboard
About getter pattern
Looking at the code a little, I saw that a good part of the structures use a getter pattern. I find this a shame because in fact, the Setting or BundleSettings structure is still missing a lot of keywords, and having to implement a setter each time is redundant. It feels like Java.
In addition, it does not contribute much in the majority of cases because
-
the structure is passed between functions as a non-mutable ref, so there is no risk of modifying it inadvertently.
-
getters provide an impl of default(), which can be automatically done with serde.
So can I start adding public fields?
Also, why not use an enum for the different targets (deb, msi, ...)
We could imagine a something like this:
enum BundleSettings {
name: Option<String>,
deb: Deb(BundleDebSettings),
msi: Msi(BundleMsiSettings),
}
And having this out of the box:
[package.metadata.bundle.example.hello.deb]