From 45f0ae17ce5528af2af66fd681e88fe4a4a7cd6e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 10:29:50 +0900 Subject: refactor(php-shim): give fstat and lstat a typed FileStat result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fstat and lstat now return Option instead of a PhpMixed array, so Platform::is_tty and Filesystem::is_junction read `mode` as a field. The array carried each of the 13 values twice — once under its numeric index and once under its name — which no caller relied on, and building it spelled the field list out four times. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/platform.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'crates/shirabe/src/util/platform.rs') diff --git a/crates/shirabe/src/util/platform.rs b/crates/shirabe/src/util/platform.rs index 2cef4109..f45294d5 100644 --- a/crates/shirabe/src/util/platform.rs +++ b/crates/shirabe/src/util/platform.rs @@ -296,11 +296,7 @@ impl Platform { }; // Check if formatted mode is S_IFCHR - if let Some(mode) = stat.get("mode").and_then(|v| v.as_int()) { - return 0o020000 == (mode & 0o170000); - } - - false + 0o020000 == (stat.mode & 0o170000) } /// Whether the current command is for bash completion -- cgit v1.3.1-4-g156e