Issue #354
In Construction, we have a build
method to apply closure to inout
struct.
We can explicitly define that with withValue
func withValue<T>(_ value: T, closure: (inout T) -> Void) -> T {
var mutableValue = value
closure(&mutableValue)
return mutableValue
}
So we can modify Protobuf structs easily
user.book = withValue(Book()) {
$0.price = 300
$0.author = withValue(Author()) {
$0.name = "Thor"
}
}