From 4f6af5f03b10db2d4c60fd77cbc081a9b1ca1e71 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 11 Aug 2025 17:43:32 +0300 Subject: [PATCH] rename files buffer --- src/public.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/public.rs b/src/public.rs index 2264eba..a90700e 100644 --- a/src/public.rs +++ b/src/public.rs @@ -103,7 +103,7 @@ impl Public { keyword: Option<&str>, sort_order: Option<(Sort, Order)>, ) -> Result, Error> { - let mut b = Vec::with_capacity(self.default_capacity); + let mut f = Vec::with_capacity(self.default_capacity); for entry in fs::read_dir(&self.root)? { let e = entry?; let p = e.path(); @@ -131,7 +131,7 @@ impl Public { }) { continue; } - b.push(File { + f.push(File { path: e.path(), modified: e.metadata()?.modified()?, }) @@ -139,11 +139,11 @@ impl Public { if let Some((sort, order)) = sort_order { match sort { Sort::Modified => match order { - Order::Asc => b.sort_by(|a, b| a.modified.cmp(&b.modified)), - Order::Desc => b.sort_by(|a, b| b.modified.cmp(&a.modified)), + Order::Asc => f.sort_by(|a, b| a.modified.cmp(&b.modified)), + Order::Desc => f.sort_by(|a, b| b.modified.cmp(&a.modified)), }, } } - Ok(b) + Ok(f) } }