Skip to content

Test and document Default for Rust records with zero-argument constructors - #10

Merged
koehlma merged 1 commit into
mainfrom
work/agents/rust-default-constructors
Oct 16, 2026
Merged

koehlma merged 1 commit into
mainfrom
work/agents/rust-default-constructors

Conversation

@koehlma

@koehlma koehlma commented Oct 16, 2026

Copy link
Copy Markdown
Member

Add compiled regression tests and documentation for the Rust builder plugin's existing Default implementation. The tests cover empty records, fields marked #[default], and optional generic fields whose type argument does not implement Default.

Rationale

Records with a zero-argument new() already implement Default by calling Self::new(), but this behavior was undocumented and had no dedicated regression coverage. The tests verify the generated code compiles and that default() and new() produce the same values and JSON representation.

Validation

  • cargo test -p sidex-serde-tests -p sidex-gen-rs --locked: 15 tests passed.
  • cargo clippy -p sidex-serde-tests -p sidex-gen-rs --all-targets --all-features --locked -- -D warnings: passed.
  • cargo +nightly-2026-07-14 fmt --all -- --check: passed.
  • uv run --project tests/py --locked pytest -q tests/py/test_json_serde.py tests/py/test_mypy.py: 59 tests passed.

Created on behalf of @koehlma by Codex / GPT-6-astra (high) · Task

@koehlma
koehlma merged commit 25a0d52 into main Oct 16, 2026
12 checks passed
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.

1 participant