Like many here, I am new to rust and just learning my way around the basics. One friction point I have hit is having personal debates over whether to use a String
or &str
in function signatures. I ran into this post which addresses this dillema and a good way forward!
http://hermanradtke.com/2015/05/06/creating-a-rust-function-that-accepts-string-or-str.html
Enjoy!