Skip to content

Commit cf0e04d

Browse files
naseschwarzNaseschwarzjuntyr
authored
Add flatten support disclaimer (#559)
* Add `flatten` support disclaimer `flatten` has proven challenging to implement. In order to enable releasing 0.9 without having documented all defects, which are mostly due to serde, add an appropriate disclaimer. See #496 --------- Co-authored-by: Naseschwarz <naseschwarz@0x53a.de> Co-authored-by: Juniper Tyree <50025784+juntyr@users.noreply.github.com>
1 parent b728254 commit cf0e04d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ Furthermore, serde imposes the following restrictions for data to roundtrip:
217217
- internally tagged newtype variants, which are `#[serde(flatten)]`ed together with other fields, must not contain:
218218
- a unit or unit struct or an untagged unit variant
219219

220+
While RON offers a best-effort implementation for `#[serde(flatten)]`, it may be unsupported in further cases and combinations not listed above. These limitations stem primarily from serde rather than RON. Enumerating all such cases based on serde's behavior is nontrivial, so the lists above are not exhaustive.
221+
220222
Please file a [new issue](https://github.com/ron-rs/ron/issues/new) if you come across a use case which is not listed among the above restrictions but still breaks.
221223

222224
While RON guarantees roundtrips like Rust -> RON -> Rust for Rust types using non-`deserialize_any`-based implementations, RON does not yet make any guarantees about roundtrips through `ron::Value`. For instance, even when RON -> Rust works, RON -> `ron::Value` -> Rust, or RON -> `ron::Value` -> RON -> Rust may not work. We plan on improving `ron::Value` in an upcoming version of RON, though this work is partially blocked on [serde#1183](https://github.com/serde-rs/serde/issues/1183).

0 commit comments

Comments
 (0)