Copy struct to slice