Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support is_human_readable #90

Open
matklad opened this issue Dec 10, 2020 · 2 comments
Open

Support is_human_readable #90

matklad opened this issue Dec 10, 2020 · 2 comments

Comments

@matklad
Copy link
Contributor

matklad commented Dec 10, 2020

Serde has this nifty API: https://docs.rs/serde/1.0.118/serde/trait.Deserializer.html#method.is_human_readable

We should use this so that toml looks like

rational = "1/3"

rather than as

rational = [1, 3]
@cuviper
Copy link
Member

cuviper commented Dec 14, 2020

If we could support deserializing either form, that sounds nice. However, I think it would be a breaking change for untagged enums, where someone expects it to fall through from a Ratio variant to a String variant.

Another option is to provide helpers for #[serde(with = "module")], like the ones we added in either.

@matklad
Copy link
Contributor Author

matklad commented Dec 15, 2020

I think we should treat this as a breaking change either way -- this is serialization format, so the other end might not even use Rust for deserialization.

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

No branches or pull requests

2 participants