aboutsummaryrefslogtreecommitdiff
path: root/lockchain-files/src/fs.rs
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2018-09-15 20:34:14 +0100
committerKatharina Fey <kookie@spacekookie.de>2018-09-15 20:34:14 +0100
commit87cb39050d938e01b7b26633dab3d141737330ed (patch)
tree0b31f4c8ab0da54f32c959664c46427dc9d9174d /lockchain-files/src/fs.rs
parent306c1e56b0dc457b59c47693c62fcab668398020 (diff)
A lot of refactoring in lockchain-files
Diffstat (limited to 'lockchain-files/src/fs.rs')
-rw-r--r--lockchain-files/src/fs.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/lockchain-files/src/fs.rs b/lockchain-files/src/fs.rs
index 1aa57bc..af47e50 100644
--- a/lockchain-files/src/fs.rs
+++ b/lockchain-files/src/fs.rs
@@ -13,7 +13,7 @@ use lcc::traits::AutoEncoder;
use std::collections::HashMap;
use std::error::Error;
-use std::io::Write;
+use std::io::{self, Write};
use std::{
fs::{self, File, OpenOptions as OO},
path::PathBuf,
@@ -70,12 +70,12 @@ impl Filesystem {
}
/// Create required directories
- pub fn scaffold(&self) -> Option<()> {
- fs::create_dir_all(&self.root).ok()?;
- fs::create_dir(&self.root.join("records")).ok()?;
- fs::create_dir(&self.root.join("metadata")).ok()?;
- fs::create_dir(&self.root.join("checksums")).ok()?;
- Some(())
+ pub fn scaffold(&self) -> Result<(), io::Error> {
+ fs::create_dir_all(&self.root)?;
+ fs::create_dir(&self.root.join("records"))?;
+ fs::create_dir(&self.root.join("metadata"))?;
+ fs::create_dir(&self.root.join("checksums"))?;
+ Ok(())
}
/// Load all files of a certain type into a Vec<String>