Derive Default for FSFileAbstraction, reduces boilerplate

This commit is contained in:
Matthias Beyer 2018-04-24 21:27:59 +02:00
parent bf363c4748
commit 6a34e7a8fd
2 changed files with 3 additions and 10 deletions

View file

@ -105,15 +105,8 @@ impl FileAbstractionInstance for FSFileAbstractionInstance {
/// `FSFileAbstraction` state type
///
/// A lazy file is either absent, but a path to it is available, or it is present.
#[derive(Debug)]
pub struct FSFileAbstraction {
}
impl FSFileAbstraction {
pub fn new() -> FSFileAbstraction {
FSFileAbstraction { }
}
}
#[derive(Debug, Default)]
pub struct FSFileAbstraction {}
impl FileAbstraction for FSFileAbstraction {

View file

@ -235,7 +235,7 @@ impl Store {
/// - On success: Store object
///
pub fn new(location: PathBuf, store_config: &Option<Value>) -> Result<Store> {
let backend = Box::new(FSFileAbstraction::new());
let backend = Box::new(FSFileAbstraction::default());
Store::new_with_backend(location, store_config, backend)
}