Conversation
NSoiffer
left a comment
There was a problem hiding this comment.
Thanks. I did a little more reading about using impl AsRef<str>. The downside is that two copies of the function might get created: one for &str and one for String. So the recommendation is to tend to use impl AsRef<str> for public facing functions where convenience matters. It was also suggested that if the function is not simple, then to make the function be a wrapper around the real function so that only the short wrapper gets copied.
Of course, there is no hard and fast rule as to what is a "short" function. set_rules_dir is definitely short. I'm not sure about set_preference though. Of course, doubling up a few longer functions is not much of an issue, but we should avoid doing so for lots of functions.
except for my one comment, everything else looks very straightforward.