Replace map_err with let-else in from_path
Consistent with the explicit if/return Err style used in validate_name.
change
commit 2ac517ae36b93ae036c1c477c1a4695eca38d0a0
author Claude <noreply@anthropic.com>
date
parent 6d89e13a
diff --git a/quire-server/src/quire/mod.rs b/quire-server/src/quire/mod.rs
index 035297c..04f688e 100644
--- a/quire-server/src/quire/mod.rs
+++ b/quire-server/src/quire/mod.rs
@@ -85,12 +85,12 @@ impl Repo {
     /// Verifies the path falls under `base` and passes name validation.
     /// Used by hooks that receive `GIT_DIR` from git.
     pub fn from_path(repos_base: &Path, path: &Path) -> Result<Self> {
-        let relative = path.strip_prefix(repos_base).map_err(|_| {
-            Error::InvalidRepoName(format!(
+        let Ok(relative) = path.strip_prefix(repos_base) else {
+            return Err(Error::InvalidRepoName(format!(
                 "path is not under repos directory: {}",
                 path.display()
-            ))
-        })?;
+            )));
+        };
         let name = relative.to_string_lossy();
         Self::validate_name(&name)?;
         Ok(Self {