Commit 81af1a3
committed
uefi: Improve the VariableKey type and iterator
Prior to this commit, the `name` field of `VariableKey` was not public, so it
was not possible to construct `VariableKey` outside of this crate. This is a
problem for unit tests that want to mock `runtime::variable_keys`; there's no
way for the unit test to construct the iterator elements.
Fix by making `name` public. Also change the `name` type from a `Vec<u16>` to a
`CString16`; this makes the type easier to work with, since in all cases
variable names should be UCS-2. The `VariableKeys` iterator now yields an error
for variables with non-UCS-2 names (but such errors do not stop iteration; you
can simply continue on to the next variable key).
Also deprecate the `VariableKey::name()` method, since it just returns the same
thing as the `name` field now.1 parent 7154676 commit 81af1a3
File tree
3 files changed
+20
-19
lines changed- uefi-test-runner/src/runtime
- uefi
- src
3 files changed
+20
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
312 | 310 | | |
| 311 | + | |
313 | 312 | | |
314 | | - | |
| 313 | + | |
315 | 314 | | |
316 | 315 | | |
317 | 316 | | |
| |||
868 | 867 | | |
869 | 868 | | |
870 | 869 | | |
871 | | - | |
872 | 870 | | |
873 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
874 | 875 | | |
875 | 876 | | |
876 | 877 | | |
877 | 878 | | |
878 | 879 | | |
| 880 | + | |
879 | 881 | | |
880 | | - | |
| 882 | + | |
881 | 883 | | |
882 | 884 | | |
883 | 885 | | |
884 | 886 | | |
885 | 887 | | |
886 | 888 | | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
| 889 | + | |
895 | 890 | | |
896 | 891 | | |
897 | 892 | | |
| |||
0 commit comments