Skip to content

Conversation

@isharma228
Copy link
Contributor

This adds the smallvec_1 feature which enables serialization and deserialization support for SmallVec from the smallvec crate.

SmallVec is supported with all serde_as conversions like DisplayFromStr, and works with any array size and element type.

The implementation required manual SerializeAs/DeserializeAs trait implementations because SmallVec's type parameter is an array type (A: Array) rather than an element type, which doesn't match the existing generic macro patterns.

@codecov
Copy link

codecov bot commented Oct 19, 2025

Codecov Report

❌ Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.80%. Comparing base (ec0ffa3) to head (c83c4fc).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
serde_with/src/de/impls.rs 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #895      +/-   ##
==========================================
+ Coverage   67.74%   67.80%   +0.06%     
==========================================
  Files          36       36              
  Lines        9509     9537      +28     
==========================================
+ Hits         6442     6467      +25     
- Misses       3067     3070       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This adds the `smallvec_1` feature which enables serialization and
deserialization support for SmallVec from the smallvec crate.

SmallVec is supported with all serde_as conversions like DisplayFromStr,
and works with any array size and element type.

The implementation required manual SerializeAs/DeserializeAs trait
implementations because SmallVec's type parameter is an array type
(A: Array) rather than an element type, which doesn't match the
existing generic macro patterns.
@jonasbb
Copy link
Owner

jonasbb commented Nov 14, 2025

Thank you for the PR. I see how the Array type complicates the implementation a bit and makes it incompatible with the existing macros.

I performed two small changes. I sorted the features in Cargo.toml alphabetically, and I removed the alloc dependency as it is unnecessary to compile.

@jonasbb jonasbb merged commit ac1f5d0 into jonasbb:master Nov 14, 2025
26 checks passed
@jonasbb jonasbb mentioned this pull request Nov 14, 2025
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