From 2936cb809da433a92f267f3bc232d88ed4e315ac Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 15 Aug 2026 14:30:43 +0900 Subject: refactor(php-shim): drop the unused opendir directory handle PhpDirHandle recorded the opened path and nothing else, and its only caller asked just whether the open had succeeded. A resource type that has to gain readdir and closedir before it means anything is worse than the std::fs::read_dir call it wraps, so Filesystem::isReadable now makes that call directly. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/filesystem.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/shirabe') diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs index 6cb33385..066b1981 100644 --- a/crates/shirabe/src/util/filesystem.rs +++ b/crates/shirabe/src/util/filesystem.rs @@ -841,8 +841,7 @@ impl Filesystem { } if is_dir(path) { - return Silencer::call(|| Ok(shirabe_php_shim::opendir(path).is_some())) - .unwrap_or(false); + return Silencer::call(|| Ok(std::fs::read_dir(path).is_ok())).unwrap_or(false); } // assume false otherwise -- cgit v1.3.1-4-g156e