David Tolnay
David Tolnay
Amusingly, this is the reverse of https://github.com/rust-lang/rustfmt/issues/5309, where a blank line is preserved between **outer** attributes and the item. For outer attrs the blank line should not be preserved. For...
I think this is behaving as intended / as documented in https://serde.rs/lifetimes.html#borrowing-data-in-a-derived-impl. You would need to write `#[serde(borrow)] Variant(Vec
Yes.
Deserializing `Cow
`Cow` behave differently from one another because their `Deserialize` impls have different signatures. This is how the different lifetime requirement between output value and input data is encoded in types....
According to the `Deserialize` impl that you have written for `FakeCow`, `FakeCow`. It does not implement `for`. So that lifetime behaves more like `Vec
I would want to know more about the use case before doing this. Would you be able to share a concrete use case that is blocked by this issue or...
@tailhook I like the approach of emitting a trait impl for some trait that is not Serialize/Deserialize but has the same signature. That seems more promising than emitting freestanding functions...
@mqudsi yes I would expect this to support deserializing using FromStr. There would need to be some external piece of logic to handle the details like converting the error types....
I think clarifying what "internal" means (as you did in your response) would be sufficient. It seems likely that a user would read that something is "internal" and understand that...