Replace assignment of array to struct with field-by-field assignment