These mostly only bloat code size and compilation times, which are already not great when we are already codegenning a billion structs and ASTs with serde derives
For AsRef, the only change is having to specify an extra 1 (one) character (&) when using String so it derefs to str, otherwise it's the same
For AsRef it's the same as AsRef when using Path/PathBuf, but it's a bit worse for string literals; but most of these functions are called with variables in the first place. except in tests which will have to use .as_ref() or Path::new
I've not removed these when using with &[] or impl IntoIterator since that does help quite a bit, e.g if you have an owning iterator of Strings, you cannot borrow inside of a map closure
I've also kept Into since that makes more sense, you want to avoid cloning if you can pass in an owned thing already, otherwise you'll clone it yourself
Also fixes some inconsistencies in function signatures for str vs path
These mostly only bloat code size and compilation times, which are already not great when we are already codegenning a billion structs and ASTs with serde derives
For AsRef, the only change is having to specify an extra 1 (one) character (&) when using
String
so it derefs tostr
, otherwise it's the sameFor AsRef it's the same as AsRef when using Path/PathBuf, but it's a bit worse for string literals; but most of these functions are called with variables in the first place. except in tests which will have to use .as_ref() or Path::new
I've not removed these when using with &[] or impl IntoIterator since that does help quite a bit, e.g if you have an owning iterator of Strings, you cannot borrow inside of a map closure
I've also kept Into since that makes more sense, you want to avoid cloning if you can pass in an owned thing already, otherwise you'll clone it yourself
Also fixes some inconsistencies in function signatures for str vs path