Commit db14067
example broken logic
Summary:
~~This implementation is broken. The test unintentionally uses the "all fields optional" branch. By adding another field to the struct that isn't optional, the "deprecated_optional_with_default_is_some" option doesn't work as expected.~~
~~I originally thought the test was only passing due to a [special conditional branch in our thrift derserialization that applies when all the fields of a struct are optional](https://www.internalfb.com/code/fbsource/[026629593ef48013189d2a74e0cb9af0baa29e86]/xplat/thrift/compiler/generate/templates/rust/lib/structimpl.mustache?lines=153-159). Now, I think the test is just wrong. I think the test struct should be instantiated with "IAMOPTWITHDEF" as the value. Then test to ensure any null or missing values get derserialized to "IAMOPTWITHDEF"~~
Back to the original idea, this test needs to be updated.
Reviewed By: diliop
Differential Revision: D76012935
fbshipit-source-id: 9872f9a4391006d07aeca387891ecb8e550f6dee1 parent 01b2ca1 commit db14067
File tree
2 files changed
+6
-1
lines changed- third-party/thrift/src/thrift/lib/rust/src/dep_tests
2 files changed
+6
-1
lines changedLines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
318 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments