Skip to content

Conversation

@dsherret
Copy link
Member

@dsherret dsherret commented May 1, 2025

Co-authored-by: nathanwhit [email protected]

@dsherret dsherret requested a review from Copilot May 1, 2025 23:00
E: de::Error,
{
Ok(Vec::new())
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seemed ok to add it here too?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a deserialization issue with #[serde(flatten)] by adding proper handling for unit values in the relevant deserializer visitors and introducing a test to verify the deserialization behavior.

  • Implements a new visit_unit method for two visitor structs to correctly handle unit deserialization.
  • Adds a new test to validate that deserialization of a struct with a flattened field works as expected.
Comments suppressed due to low confidence (1)

src/registry.rs:1301

  • [nitpick] The test function name 'example_deserialization_fail' is misleading since the test asserts that deserialization is successful. Consider renaming it (e.g., to 'example_deserialization_success') to reflect the expected outcome more clearly.
fn example_deserialization_fail() {

Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dsherret dsherret merged commit 39a775e into denoland:main May 1, 2025
1 check passed
@dsherret dsherret deleted the chore_deserialization_failure branch May 1, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants