|
1 | 1 | #[cfg(target_os = "windows")]
|
2 | 2 | extern crate winapi;
|
3 | 3 |
|
4 |
| -use super::{KVStore, KVStoreUnpersister, TransactionalWrite}; |
| 4 | +use super::{KVStore, TransactionalWrite}; |
5 | 5 |
|
6 | 6 | use std::fs;
|
7 | 7 | use std::io::{BufReader, BufWriter, Read, Write};
|
@@ -90,7 +90,7 @@ impl KVStore for FilesystemStore {
|
90 | 90 | }
|
91 | 91 |
|
92 | 92 | if dest_file.is_file() {
|
93 |
| - return Err(std::io::Error::new(std::io::ErrorKind::Other, "Unpersisting key failed")); |
| 93 | + return Err(std::io::Error::new(std::io::ErrorKind::Other, "Removing key failed")); |
94 | 94 | }
|
95 | 95 |
|
96 | 96 | Ok(true)
|
@@ -256,20 +256,6 @@ impl KVStorePersister for FilesystemStore {
|
256 | 256 | }
|
257 | 257 | }
|
258 | 258 |
|
259 |
| -impl KVStoreUnpersister for FilesystemStore { |
260 |
| - fn unpersist(&self, key: &str) -> std::io::Result<bool> { |
261 |
| - let msg = format!("Could not retrieve file for key {}.", key); |
262 |
| - let dest_file = PathBuf::from_str(key) |
263 |
| - .map_err(|_| lightning::io::Error::new(lightning::io::ErrorKind::InvalidInput, msg))?; |
264 |
| - let msg = format!("Could not retrieve parent directory of {}.", dest_file.display()); |
265 |
| - let parent_directory = dest_file |
266 |
| - .parent() |
267 |
| - .ok_or(lightning::io::Error::new(lightning::io::ErrorKind::InvalidInput, msg))?; |
268 |
| - let namespace = parent_directory.display().to_string(); |
269 |
| - self.remove(&namespace, key) |
270 |
| - } |
271 |
| -} |
272 |
| - |
273 | 259 | #[cfg(test)]
|
274 | 260 | mod tests {
|
275 | 261 | use super::*;
|
|
0 commit comments