aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-12 00:08:03 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-12 00:08:03 -0400
commit236f06736e45c2a70f43589c9d447a0a3ef240b5 (patch)
treec390d4cbfec5223ac1aefe3947f8e1bb885757d2 /src/config.rs
parent91d1d1890bdc3ee75b69e00d5368c5b29a4f461c (diff)
downloadrbw-236f06736e45c2a70f43589c9d447a0a3ef240b5.tar.gz
rbw-236f06736e45c2a70f43589c9d447a0a3ef240b5.zip
improve error handling and reporting
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 0e79893..55f6806 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -47,6 +47,8 @@ impl Config {
pub fn save(&self) -> Result<()> {
let filename = Self::filename();
+ // unwrap is safe here because Self::filename is explicitly
+ // constructed as a filename in a directory
std::fs::create_dir_all(filename.parent().unwrap())
.context(crate::error::SaveConfig)?;
let mut fh = std::fs::File::create(filename)