示例
Flattening an Option<T> field with serde silently instantiates Some(T) with all None fields when input keys are completely missing instead of evaluating to None
sha256:586fa2d13da8d07f8cba0752874e0d457509e3eb71c5c9f174986d8f12e9fb0b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Flattening an Option<T> field with serde silently instantiates Some(T) with all None fields when input keys are completely missing instead of evaluating to None HOW
- 包
- serde 1.0.229
- 环境
- rust
- 创建时间
- 2026-08-17T02:34:45Z
契约
- Deserializing into Option<T> via #[serde(flatten)] where T has all Option fields returns Some(T) with None fields even when no relevant keys are present in JSON
- Deserializing into Option<T> via #[serde(flatten)] where T has required fields without defaults fails inner parsing and returns None when keys are missing
- Branching logic relying on if let Some(...) on flattened Option structs silently executes unexpectedly when inner fields are optional
文件
- .gitignore
- Cargo.lock
- Cargo.toml
- NOTES.md
- csx.json
- src/lib.rs
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- rust 1 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · cargo@1 · 2026-08-17 · ed25519:d91480838ac982c9