aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/cache.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 09:34:34 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 09:34:34 +0900
commitdfd98ce4b227a3a14dc913c669bee4f077a65178 (patch)
treedef0558566319a18ffbcdc4eb4e5175e3c6c9bb0 /crates/shirabe/src/cache.rs
parentd2a28f8c07b0aa713be338005c6153011d70f24b (diff)
downloadphp-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.tar.gz
php-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.tar.zst
php-shirabe-dfd98ce4b227a3a14dc913c669bee4f077a65178.zip
refactor(php-shim): make the fs mutators return Result
mkdir, rmdir, unlink and symlink each had a bool version and a _result twin returning the io::Error, which left two names for one call. Keep only the Result form and let the callers that want a boolean spell out .is_ok(). Call sites that discard the outcome, as their PHP originals do, are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/cache.rs')
-rw-r--r--crates/shirabe/src/cache.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/shirabe/src/cache.rs b/crates/shirabe/src/cache.rs
index a9f56eac..14f7287f 100644
--- a/crates/shirabe/src/cache.rs
+++ b/crates/shirabe/src/cache.rs
@@ -106,7 +106,8 @@ impl Cache {
if !self.read_only
&& ((!is_dir(&self.root)
- && !Silencer::call(|| Ok(mkdir(&self.root, 0o777, true))).unwrap_or(false))
+ && !Silencer::call(|| Ok(mkdir(&self.root, 0o777, true).is_ok()))
+ .unwrap_or(false))
|| !is_writable(&self.root))
{
self.io.write_error(&format!(