Attention is currently required from: Evan Benn.
Peter Marheine has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/71973 )
Change subject: flashrom_tester: Rewrite IOOpts to support more operations ......................................................................
Patch Set 5:
(1 comment)
File util/flashrom_tester/flashrom/src/cmd.rs:
https://review.coreboot.org/c/flashrom/+/71973/comment/b79c4b9e_194537a7 PS4, Line 82: // an operation must provide a file or a region.file or both.
I tried it a bit like this way initially, I didn't like that the things inside the enum variants don […]
If each operation can take both a region and file path (or more generally, if every operation can take the same options), then it seems okay to not put fields in the `Operation` and instead put it alongside a `Region` like I've outlined; the bigger win seems like how the `Region` better expresses where data might come from.
If you want named fields you can always use struct variants (so you don't need to define more structs):
``` enum Operation { Read { region: Region, path: Path } ... } ```