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

Split class names on whitespace when using tuple or Vec #1084

Merged
merged 3 commits into from Apr 14, 2020

Conversation

bryanjswift
Copy link
Contributor

Change Classes::push to use the existing From<&str> for Classes implementation which uses str::split_whitespace. The impl<T: AsRef<str>> From<Vec<T>> for Classes has likewise been changed to use str::split_whitespace on each of the members of the incoming Vec.

Add tests to cover the new expected behavior of the functions related to the Classes struct.

Fixes #935

When creating a `VTag` with `class` assigned from a `Vec` the items in
`Vec` were not split on whitespace and so were not enforced as unique in
the same way a `VTag` with `class` assigned from `tuple`.
@jstarry jstarry merged commit 4167c51 into yewstack:master Apr 14, 2020
@bryanjswift bryanjswift deleted the 935-classnames branch April 14, 2020 04:10
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.

Can not use spaces in class names when using List/Vec
2 participants