Why is it discouraged to accept a reference &String, &Vec, or &Box as a function argument?
TL;DR: One can instead use &str, &[T] or &T to allow for more generic code. One of the main reasons to use a String or a Vec is because they allow increasing or decreasing the capacity. However, when you accept an immutable reference, you cannot use any of those interesting methods on the Vec or … Read more