Commit 721cd55
committed
Auto merge of #14000 - linyihai:fix-env-prefix, r=weihanglo
Fix: Skip deserialization of unrelated fields with overlapping name
### What does this PR try to resolve?
Split from #13687 (comment)
This fixes the overlap of environment variable names:
> For example, when env_key is UNSTABLE_GITOXIDE_FETCH
and field_key is UNSTABLE_GIT, the field shouldn't be
added because `unstable.gitoxide.fetch` doesn't
belong to `unstable.git` struct.
### How should we test and review this PR?
Updates of test cases `struct_with_overlapping_inner_struct_and_defaults` can be used to compare changes before and after changes
### Additional information
r? weihanglo and very appreciate your more optimized code2 files changed
+26
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1454 | 1454 | | |
1455 | 1455 | | |
1456 | 1456 | | |
1457 | | - | |
1458 | 1457 | | |
1459 | 1458 | | |
1460 | 1459 | | |
| |||
1466 | 1465 | | |
1467 | 1466 | | |
1468 | 1467 | | |
1469 | | - | |
| 1468 | + | |
1470 | 1469 | | |
1471 | 1470 | | |
1472 | 1471 | | |
| |||
1475 | 1474 | | |
1476 | 1475 | | |
1477 | 1476 | | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
1478 | 1493 | | |
1479 | 1494 | | |
1480 | 1495 | | |
| |||
0 commit comments