mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Various improvements to Classes, oriented around reducing allocations
- `push` no longer performs unnecessary allocations if `self` is empty.
- Most constructors (FromIterator, From, Extend) are now oriented around push, to take advantage of this
- `to_string` and `into_prop_value`:
- No longer allocate an unnecessary `Vec`; they instead preallocate a string of the correct length and push into it directly.
- No longer use a length check + `unsafe`; they instead match over a fallible .next() and proceed from there.
- Additionally, `into_prop_value` no longer builds a `String` or `Rc` if `Classes` contains a single `&'static str` or is empty.
- `From<String>` no longer clones the string if it contains a single class.
- `impl Eq for Classes`
* Fix duplicated is_empty test