Commit 8898527
committed
refactor: validate
This makes the APIs more ergonomic, as most of the methods that used to
return `Result<T, E>`, return `T` now instead, making it much easier to
work with, especially in case of iterators.
This obviously causes the constructor to run in linear time, which
shouldn't be a huge problem considering that any sensible use of the
parser will require linear-time traversal time anyway. In case this
would be a problem, however, a separate constructor that skips the
validation (and causes the traverse methods to panic instead) is added.
This also allows us to unify some error handling between in-memory and
internal representation APIs, bringing us closer to unifying these two APIs
under a common trait, and supporting the "standard nodes & properties"
for the internal representation variant.Fdt on construction1 parent 1a6accb commit 8898527
File tree
17 files changed
+740
-772
lines changed- src
- fdt
- model
- standard
- tests
17 files changed
+740
-772
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 67 | | |
74 | 68 | | |
75 | 69 | | |
| |||
103 | 97 | | |
104 | 98 | | |
105 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
0 commit comments