Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Enhancement: Allow compact one-line representation of some fields #402

Closed
nyurik opened this issue Dec 23, 2023 · 1 comment
Closed

Enhancement: Allow compact one-line representation of some fields #402

nyurik opened this issue Dec 23, 2023 · 1 comment

Comments

@nyurik
Copy link

nyurik commented Dec 23, 2023

In some cases, the author may know for sure that the structure of a field will be compact enough to be representable as a one-liner:

name: My geometries
bounds: [ -10, -23, 15, 22 ]
tags: [tag1, tag2]

The bounds field is known to always have four numbers, so it would be good to force serde to NOT serialize it like this:

name: My geometries
bounds:
    - -10
    - -23
    - 15
    - 22
tags:
    - tag1
    - tag2
@dtolnay
Copy link
Owner

dtolnay commented Dec 23, 2023

I do not plan to support this in this crate, but someone else should feel free to pursue creating a more fully-featured YAML library that could serve this use case.

@dtolnay dtolnay closed this as completed Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants