Create A Directory In Rust If It Doesn't Already Exist
This is the function I use to make sure a directory exists before trying to do something with it. If the target directory doesn't exist, it'll be made recursively. If it can't be made for some reason it'll throw an error. Note that just because the directory exists doesn't mean the permissions are writeable.
use fs;
use PathBuf;
Output:
Verified the directory exists
-- end of line --