summaryrefslogtreecommitdiff
path: root/src/storage.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-10-31 10:59:52 -0400
committerMica White <botahamec@outlook.com>2026-10-31 10:59:52 -0400
commitfde01cceb898b944b646a8fed1ce81cb14e523ef (patch)
treed1d5c97350fbbba2cc522c1f539c320ad4c2d1fc /src/storage.rs
parent0c128e472b1b49e32c313874eaeccc8c5f1b1202 (diff)
Testing and optimization
Diffstat (limited to 'src/storage.rs')
-rw-r--r--src/storage.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/storage.rs b/src/storage.rs
index c099481..ba06ab2 100644
--- a/src/storage.rs
+++ b/src/storage.rs
@@ -78,6 +78,9 @@ impl StorageManager {
self.data = Some(data.clone());
unblock(move || {
if let Err(e) = {
+ if let Some(parent) = tmp_file.parent() {
+ std::fs::create_dir_all(parent)?;
+ }
std::fs::write(&tmp_file, &data)?;
let saved_data = std::fs::read(&tmp_file)?;