Author: Jason White [jwhite@esri.com]
Hash: d0f9b528729ee42dccdfdd3f27c1c3c127f24385
Timestamp: Mon, 08 Jul 2019 19:21:06 +0000 (5 years ago)

+0 -34 +/-1 browse
Remove dead code
1diff --git a/src/lru.rs b/src/lru.rs
2index ee070fc..5744d97 100644
3--- a/src/lru.rs
4+++ b/src/lru.rs
5 @@ -114,38 +114,4 @@ where
6 None
7 }
8 }
9-
10- /// Returns a future that prunes the least recently used entries that cause
11- /// the cache to exceed the given maximum size.
12- ///
13- /// If the stream is thrown away, then the items will not be deleted.
14- #[cfg(none)]
15- pub fn prune(
16- &mut self,
17- root: PathBuf,
18- max_size: u64,
19- ) -> impl Future<Item = usize, Error = io::Error> {
20- if max_size == 0 {
21- return Either::A(future::ok(0));
22- }
23-
24- let mut to_delete = Vec::new();
25-
26- while self.size() > max_size {
27- if let Some((oid, _)) = self.pop() {
28- to_delete.push(oid);
29- }
30- }
31-
32- Either::B(stream::iter_ok(to_delete).fold(0, move |acc, oid| {
33- let path = root.join(format!("objects/{}", oid.path()));
34-
35- fs::remove_file(path)
36- .map_err(move |e| {
37- log::error!("Failed to delete '{}' ({})", oid, e);
38- e
39- })
40- .map(move |()| acc + 1)
41- }))
42- }
43 }