yew/packages
Nathan West 6751946477
Various improvements to Classes, oriented around reducing allocations (#2870)
* 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
2022-09-21 13:41:10 +09:00
..
2022-06-24 20:17:58 +02:00