Filtering a Vec of structs and creating new vector of Strings or strs in Rust
The [..] slicing operation isn't going to cost anything, but isn't very descriptive either. I'd want to call s.style.as_str() instead.
As for the return type, I'd agree that &amp;str is more appropriate, since it is the more general type. The functionality of a String is a superset of what you can do with a str, so it's irrelevant when that extra functionality isn't useful to the caller