-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OwnedLazyValue
does not work in enum cases
#84
Comments
Thanks, i will investigate it |
Line 43 in 1a6c675
I'm not sure. According to this implementation, we can know that The following code works: fn main() {
let json_str1 = r#"{ "field1": { "value": "value1" }, "field2": "value2" }"#;
let json_str2 = r#"{ "field_a": "valueA", "field_b": "valueB" }"#;
process_json(json_str1);
process_json(json_str2);
} |
this is an expected behavior because we hacked the visitor when using |
Describe the bug
When I have to deserialize several different json objects, I want to use enum to unify the deserialization. And I also want to use
OwnedLazyValue
, but I found that theOwnedLazyValue
does not work in enum cases.To Reproduce
I must use
deserialize_owned_lazy_value
to deserialize field1.Expected behavior
I want the
OwnedLazyValue
works as in not enum cases. I don't need to write my own deserialization function.sonic-rs version:
0.3
Environment:
Ubuntu 22.04, Rust 1.77
The text was updated successfully, but these errors were encountered: