diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-04-12 01:29:14 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-04-12 01:37:35 -0400 |
commit | 14b647f9d6dbb76960e6cad6f51531ea6a8dbf3a (patch) | |
tree | a9d1c38e7c03f1cb8d1309a4623c46d636366367 /src/db.rs | |
parent | 236f06736e45c2a70f43589c9d447a0a3ef240b5 (diff) | |
download | rbw-14b647f9d6dbb76960e6cad6f51531ea6a8dbf3a.tar.gz rbw-14b647f9d6dbb76960e6cad6f51531ea6a8dbf3a.zip |
avoid throwing errors for things we don't care about
Diffstat (limited to 'src/db.rs')
-rw-r--r-- | src/db.rs | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -83,7 +83,13 @@ impl Db { pub fn remove(email: &str) -> Result<()> { let filename = Self::filename(email); - std::fs::remove_file(filename).context(crate::error::RemoveDb)?; + let res = std::fs::remove_file(filename); + if let Err(e) = &res { + if e.kind() == std::io::ErrorKind::NotFound { + return Ok(()); + } + } + res.context(crate::error::RemoveDb)?; Ok(()) } |