• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facet-rs / facet / 20107317130
58%

Build:
DEFAULT BRANCH: main
Ran 10 Dec 2025 05:22PM UTC
Jobs 1
Files 218
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Dec 2025 05:20PM UTC coverage: 58.573% (-0.06%) from 58.628%
20107317130

push

github

fasterthanlime
fix: serialize/deserialize untagged unit variants as strings

Fixes #1228

Previously, untagged enums with unit variants would serialize to `null`
(matching serde behavior), making it impossible to distinguish between
different unit variants. This broke roundtripping for enums like:

```rust
#[facet(untagged)]
enum Alla {
    AE,
    AD,
}
```

Changes:
- JSON: Unit variants in untagged enums now serialize as variant name
  strings (e.g., "AE") instead of null
- JSON: Deserialization now accepts variant name strings for unit variants
- YAML: Same deserialization fix (serialization already used variant names)
- Tests: Updated to reflect new behavior and document divergence from serde

This intentionally diverges from serde's behavior because:
1. Serde's null serialization makes multiple unit variants indistinguishable
2. Facet's approach enables proper roundtripping
3. Behavior is now consistent between tagged and untagged enums with
   unit variants

Breaking change: Code that relied on untagged unit variants serializing
to null will need to be updated. However, this previous behavior was
arguably broken as it prevented distinguishing between variants.

13 of 17 new or added lines in 3 files covered. (76.47%)

27 existing lines in 1 file now uncovered.

27117 of 46296 relevant lines covered (58.57%)

616.11 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
52.74
-0.12% facet-yaml/src/deserialize.rs

Uncovered Existing Lines

Lines Coverage ∆ File
27
57.37
-1.12% facet-json/src/deserialize.rs
Jobs
ID Job ID Ran Files Coverage
1 20107317130.1 10 Dec 2025 05:22PM UTC 218
58.57
GitHub Action Run
Source Files on build 20107317130
  • Tree
  • List 218
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • fe153189 on github
  • Prev Build on main (#20102737478)
  • Next Build on main (#20109439374)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc