Simplify SqliteStore::from_path
This commit is contained in:
parent
ca6b38d49e
commit
6d80e53232
|
@ -69,17 +69,11 @@ impl SqliteStore {
|
||||||
let blobpath = path.join("dir_blobs/");
|
let blobpath = path.join("dir_blobs/");
|
||||||
let lockpath = path.join("dir.lock");
|
let lockpath = path.join("dir.lock");
|
||||||
|
|
||||||
#[cfg(target_family = "unix")]
|
|
||||||
if !readonly {
|
if !readonly {
|
||||||
std::fs::DirBuilder::new()
|
let mut builder = std::fs::DirBuilder::new();
|
||||||
.recursive(true)
|
#[cfg(target_family = "unix")]
|
||||||
.mode(0o700)
|
builder.mode(0o700);
|
||||||
.create(&blobpath)
|
builder
|
||||||
.with_context(|| format!("Creating directory at {:?}", &blobpath))?;
|
|
||||||
}
|
|
||||||
#[cfg(not(target_family = "unix"))]
|
|
||||||
if !readonly {
|
|
||||||
std::fs::DirBuilder::new()
|
|
||||||
.recursive(true)
|
.recursive(true)
|
||||||
.create(&blobpath)
|
.create(&blobpath)
|
||||||
.with_context(|| format!("Creating directory at {:?}", &blobpath))?;
|
.with_context(|| format!("Creating directory at {:?}", &blobpath))?;
|
||||||
|
|
Loading…
Reference in New Issue