Skip to content

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

Merged
jstarry merged 3 commits intoyewstack:masterfrom
bryanjswift:935-classnames
Apr 14, 2020
Merged

Split class names on whitespace when using tuple or Vec#1084
jstarry merged 3 commits intoyewstack:masterfrom
bryanjswift:935-classnames

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