What should the getter for a Vec|String| return, &[&str]? What about Option|Vec|String||?
jpfreely @ jpfreely @programming.dev Posts 6Comments 11Joined 2 yr. ago
jpfreely @ jpfreely @programming.dev
Posts
6
Comments
11
Joined
2 yr. ago
What should the getter for a Vec|String| return, &[&str]? What about Option|Vec|String||?
Caught: 2.5 hour documentary voice over: "As of my knowledge cutoff in September 2021"
Right, I want the convenience of &[&str] , but if it requires creating a second collection then I think &[String] is better. Use cases that require &str can just map to as_str.