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

Make SingletonMap public #4

Merged
merged 1 commit into from
May 26, 2024
Merged

Conversation

asomers
Copy link
Contributor

@asomers asomers commented May 24, 2024

It can be used in cases where #[serde(with = "singleton_map")] is too restrictive, for example where custom with modules are required.

Fixes #1

It can be used in cases where #[serde(with = "singleton_map")] is too
restrictive, for example where custom `with` modules are required.

Fixes acatton#1

Signed-off-by: Alan Somers <[email protected]>
@asomers asomers force-pushed the pub-SingletonMap branch from 119b276 to dbf4e75 Compare May 24, 2024 22:25
@acatton
Copy link
Owner

acatton commented May 26, 2024

This pull request is great, documentation and everything.

However, I can't guarantee that this API will be maintained once I stabilize the whole crate. I hijacked your pull request and added a warning in the documention.

As I said in the documentation, this API won't be replaced without providing an alternative solution to the original problem described in #1 .

In the mean time this will get merged and I'll craft a new minor release. I don't want to block you, I'm just giving you a heads up: this API might break, but I'll deprecate it one version before removing it, and give an alternative solution to your problem.

Best case scenario, I can't find a better alternative to your API, and it becomes part of my plan for serde-yaml-ng 1.0.

@acatton acatton closed this in 7f0ca8e May 26, 2024
@acatton acatton merged commit dbf4e75 into acatton:master May 26, 2024
11 checks passed
@acatton
Copy link
Owner

acatton commented May 26, 2024

This was released in https://crates.io/crates/serde_yaml_ng/0.10.0

@asomers asomers deleted the pub-SingletonMap branch May 26, 2024 21:55
@asomers
Copy link
Contributor Author

asomers commented May 26, 2024

Thanks very much @acatton! BTW, another solution to the same problem would be support for nested enums, as described here: dtolnay/serde-yaml#405 .

@acatton
Copy link
Owner

acatton commented May 26, 2024

Ahh! Thanks for the hint @asomers I want to look deeper into this (See #6 ) once I get a good grasp of this part of the code.

You'll know if I change my mind when your code starts spitting out deprecation warnings 😁 .

Cheers!

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

Successfully merging this pull request may close these issues.

singleton_map is too limited
2 participants