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

Implement FromStr for JsString #2625

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

Jules-Bertholet
Copy link
Contributor

No description provided.

@Jules-Bertholet Jules-Bertholet force-pushed the implement-traits branch 2 times, most recently from 18f2281 to 5e5dbd9 Compare July 17, 2021 15:05
src/lib.rs Outdated
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self::from_str(s))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit hesitatnt to have this impl since JsValue is so generic. Often FromStr is used in parsing contexts so one might expect this to parse a float, for example, rather than producing a string value.

Is this required by a use case of yours or would it be ok to leave it out for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't need this for anything, I just noticed while adding other impls that this one would be easy to add in as well. I'll remove it

@Jules-Bertholet Jules-Bertholet changed the title Implement FromStr for JsString and JsValue Implement FromStr for JsString Jul 19, 2021
@alexcrichton alexcrichton merged commit c2f6b00 into rustwasm:master Jul 20, 2021
@Jules-Bertholet Jules-Bertholet deleted the implement-traits branch July 20, 2021 16:54
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.

2 participants