Attention is currently required from: Evan Benn.
1 comment:
File util/flashrom_tester/flashrom/src/cmd.rs:
Patch Set #4, 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 }
...
}
```
To view, visit change 71973. To unsubscribe, or for help writing mail filters, visit settings.