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

Implement FromStr for Number #381

Closed
FaveroFerreira opened this issue Jul 17, 2023 · 1 comment · Fixed by #382
Closed

Implement FromStr for Number #381

FaveroFerreira opened this issue Jul 17, 2023 · 1 comment · Fixed by #382

Comments

@FaveroFerreira
Copy link

Is it possible to implement FromStr for Number?

With serde_json I can do stuff like

serde_json::Value::Number(text.parse::<serde_json::Number>()?);

This will make it easier to parse numbers with serde_yaml.

@dtolnay
Copy link
Owner

dtolnay commented Jul 17, 2023

Good idea. Thanks! Added in serde_yaml 0.9.24.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants