Commit 14d13c1
committed
refactor: Make MachineConfigUpdate::is_empty forward compatible
Instead of listing out each field in the function (which is error prone
in case more fields get added, because the compiler will not be able to
detect that they might be missing from the `is_empty` condition),
compare against `Default::default`, which will automatically include all
future fields in the comparision, and `Default::default()` will always
set all fields to `None`.
Signed-off-by: Patrick Roy <roypat@amazon.co.uk>1 parent aa29bff commit 14d13c1
1 file changed
+2
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 88 | + | |
98 | 89 | | |
99 | 90 | | |
100 | 91 | | |
| |||
0 commit comments