Commit 0f3ed0b
committed
refactor:
This method looks strongly adapted from the `from_json_value` method in `format/json.rs`.
- The ordering was different, so I adjusted it to reflect the same match ordering used in the json format parser.
- `val` => `value`
- No need to dereference values, in this case we consume the `value` parameter, rather than expect a reference to borrow. No need to use `ref` or `clone()` to create owned values.
- Could adopt the iter + collect pattern used by other formats instead of the for loop used for array and object types.
Signed-off-by: Brennan Kinney <[email protected]>from_gura_value (json referenced)1 parent 48d7de8 commit 0f3ed0b
1 file changed
+19
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | | - | |
29 | | - | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
46 | 41 | | |
47 | 42 | | |
48 | | - | |
49 | | - | |
| 43 | + | |
| 44 | + | |
50 | 45 | | |
51 | 46 | | |
52 | 47 | | |
53 | 48 | | |
54 | 49 | | |
| 50 | + | |
| 51 | + | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
0 commit comments