aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index a750693..95da739 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -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(())
}