How can I define a public struct in Rust where all the fields are public without having to repeat pub
modifier in front of every field?
A pub_struct
macro would be ideal:
pub_struct! Foo {
a: i32,
b: f64,
// ...
}
which would be equivalent to:
pub struct Foo {
pub a: i32,
pub b: f64,
//...
}