3 ms·
Note that everything but String and str are not used that often, and when they are, its straightforward. You'll probably use them in cases like `File::new(Path:
by Manishearth 11y ago
Note that everything but String and str are not used that often, and when they are, its straightforward. You'll probably use them in cases like `File::new(Path::new(my_string))` with some error handling if necessary, and forget that the intermediate existed. In fact, many of these APIs use std::convert trait magic so that you don't need to manually convert to the intermediate type at all. You also see these string types used when they are read, stored, and reused later. I haven't seen many cases of string-type-specific gymnastics being done, except sometimes with paths (which you can treat as a list of characters as well as a list of segments).