Add proper impl of Store::reset_backend()
This commit is contained in:
parent
c814171875
commit
a4188a3100
1 changed files with 5 additions and 3 deletions
|
@ -320,9 +320,11 @@ impl Store {
|
|||
/// Currently, this is the naive implementatoin which does not transfer contents of the
|
||||
/// backends.
|
||||
///
|
||||
pub fn reset_backend(&mut self, backend: Box<FileAbstraction>) -> Result<()> {
|
||||
self.backend = backend;
|
||||
Ok(())
|
||||
pub fn reset_backend(&mut self, mut backend: Box<FileAbstraction>) -> Result<()> {
|
||||
self.backend
|
||||
.drain()
|
||||
.and_then(|drain| backend.fill(drain))
|
||||
.map(|_| self.backend = backend)
|
||||
}
|
||||
|
||||
/// Get the store configuration
|
||||
|
|
Loading…
Reference in a new issue