`serialize_i64` not writing an int64 msgpack type when value fits into something smaller
Open
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 162
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to use `[serde(serialize_with = "myfunc")]` to serialize a `std::time::Duration` type, where `myfunc` is defined as:
```
fn myfunc(duration: &std::time::Duration, serializer: S) -> Result
where
S: Serializer,
{
serializer.serialize_i64(duration.as_millis() as i64)
}
```
When I attempt to serialize the struct with a Duration value of 256 using `to_vec_named()`, the serialized msgpack contains [cd, 1, 0] for the value.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.