Create A Directory In Rust If It Doesn't Already Exist
rust
use fs;
use PathBuf;
Verified the directory exists
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.