Silly rust tip, this did not do what I thought it would do:
let config_dir = Path::new("~/.config/my_app");
create_dir_all(config_dir)?;
let config_file = Path::new("~/.config/my_app/my_config")
write(config_file, thing_to_write);
This created a new directory "~" in my current working directory, and then created nested subdirs "./~/.config/my_app" and that's where my config file was written.
