From 576ce8fa7f130ff28cd7e9a452f44ac72e395878 Mon Sep 17 00:00:00 2001 From: niluxv Date: Mon, 27 Jan 2020 18:04:17 +0100 Subject: [PATCH] Fix copy/paste error in "Add `PathBackend` with atomic saves" where `PathDatabase::open` would yield a `FileDatabase` --- src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2c95bea..8433972 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -680,10 +680,12 @@ impl Database { /// Create new [`PathDatabase`] from a [`Path`](std::path::Path). pub fn from_path(path: S, data: Data) - -> error::Result> - where S: AsRef + -> error::Result> + where S: ToOwned, + std::path::PathBuf: std::borrow::Borrow { - let backend = FileBackend::open(path).context(error::RustbreakErrorKind::Backend)?; + let backend = PathBackend::open(path.to_owned()) + .context(error::RustbreakErrorKind::Backend)?; Ok(Database { data: RwLock::new(data),