From 340965b1f5f810414742076501a2fff8a39db674 Mon Sep 17 00:00:00 2001 From: Vika Date: Mon, 27 Sep 2021 17:41:19 +0300 Subject: Code cleanup and Cargo.lock updates --- src/database/file/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/database/file/mod.rs') diff --git a/src/database/file/mod.rs b/src/database/file/mod.rs index 78b67fb..acbb44b 100644 --- a/src/database/file/mod.rs +++ b/src/database/file/mod.rs @@ -1,5 +1,5 @@ use async_std::fs::{File, OpenOptions}; -use async_std::io::{ErrorKind as IOErrorKind, BufReader}; +use async_std::io::{ErrorKind as IOErrorKind}; use async_std::io::prelude::*; use async_std::task::spawn_blocking; use async_trait::async_trait; @@ -177,6 +177,7 @@ pub struct FileStorage { } impl FileStorage { + /// Create a new storage wrapping a folder specified by root_dir. pub async fn new(root_dir: PathBuf) -> Result { // TODO check if the dir is writable Ok(Self { root_dir }) @@ -237,7 +238,7 @@ impl Storage for FileStorage { .create_new(true) .open(&path) .await?; - + let mut lock = get_lockable_file(f).await; let mut guard = lock.write()?; -- cgit 1.4.1