aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/cache.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 20:49:33 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 21:11:50 +0900
commitb15166490944e90c083c93086e849656535494e3 (patch)
tree4a517d8284b5d1574072c1098b8f0c3109cf12cd /crates/shirabe/src/cache.rs
parenta5ebca8f7001351aa26443a4a02a71c96190eccb (diff)
downloadphp-shirabe-b15166490944e90c083c93086e849656535494e3.tar.gz
php-shirabe-b15166490944e90c083c93086e849656535494e3.tar.zst
php-shirabe-b15166490944e90c083c93086e849656535494e3.zip
fix(path): propagate PathBuf
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/cache.rs')
-rw-r--r--crates/shirabe/src/cache.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/shirabe/src/cache.rs b/crates/shirabe/src/cache.rs
index 532de41..315ba2c 100644
--- a/crates/shirabe/src/cache.rs
+++ b/crates/shirabe/src/cache.rs
@@ -325,14 +325,14 @@ impl Cache {
expire.format(date_format_to_strftime("Y-m-d H:i:s"))
));
for file in &mut finder {
- let _ = self.filesystem.borrow_mut().unlink(&file.get_pathname());
+ let _ = self.filesystem.borrow_mut().unlink(&file);
}
let mut total_size = self.filesystem.borrow_mut().size(&self.root).unwrap_or(0);
if total_size > max_size {
let mut iterator = self.get_finder().sort_by_accessed_time().get_iterator();
while total_size > max_size && iterator.valid() {
- let filepath = iterator.current().get_pathname();
+ let filepath = iterator.current();
total_size -= self.filesystem.borrow_mut().size(&filepath).unwrap_or(0);
let _ = self.filesystem.borrow_mut().unlink(&filepath);
iterator.next();
@@ -361,10 +361,7 @@ impl Cache {
expire.format(date_format_to_strftime("Y-m-d H:i:s"))
));
for file in &mut finder {
- let _ = self
- .filesystem
- .borrow_mut()
- .remove_directory(&file.get_pathname());
+ let _ = self.filesystem.borrow_mut().remove_directory(&file);
}
*CACHE_COLLECTED.lock().unwrap() = Some(true);