The hyper crate offers two options for passing a url to a function: Using the trait
IntoUrl or directly taking a
IntoUrl seems nicer in the first place, because it allows passing e.g. a String to function, but then the function does need to handle possible faults when converting
Url guarantees a valid url, but the caller is forced to convert his strings first.
So I was wondering which one to prefer. Or more generally speaking: What are the advantages and disadvantages of using IntoSomeStruct vs. SomeStruct in general? Is there some rule of thumb when to use which?