fix: remove invalid #[serde(flatten)] from branch deserialization test#49
Merged
bashandbone merged 1 commit intomainfrom Apr 6, 2026
Merged
fix: remove invalid #[serde(flatten)] from branch deserialization test#49bashandbone merged 1 commit intomainfrom
#[serde(flatten)] from branch deserialization test#49bashandbone merged 1 commit intomainfrom
Conversation
Agent-Logs-Url: https://github.com/bashandbone/submod/sessions/a8d4f54d-5310-40c5-af50-2049b8588478 Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
bashandbone
April 6, 2026 18:34
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a failing/panicking TOML deserialization test by removing an invalid #[serde(flatten)] usage on a string-backed type, ensuring the test exercises SerializableBranch’s deserializer and produces the intended “invalid branch value” error.
Changes:
- Remove
#[serde(flatten)]from the test-onlyHelperwrapper struct used for TOML parsing. - Add
#[expect(dead_code)]to suppress the resulting “unused field” warning for a field only populated via deserialization.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_branch_deserialize_from_toml_rejects_empty_and_whitespacewas panicking withcan only flatten structs and mapsinstead of the expectedinvalid branch valueerror, becauseSerializableBranchdeserializes as a plain string — incompatible with serde'sflatten, which requires a struct or map.Changes
src/options.rs: Remove#[serde(flatten)]from the localHelperstruct in the test. A plain named field is sufficient sincetoml::from_strwithbranch = ""maps directly toHelper { branch: SerializableBranch }, correctly delegating toSerializableBranch's deserializer and surfacing theinvalid branch valueerror.#[expect(dead_code)]on the field to suppress the resulting lint (field is consumed only via deserialization).