model: collapse parse_result_ref's dead else branch into `?`
commit
705e9e8model: collapse parse_result_ref's dead else branch into `?`
clippy::question_mark flagged the self/* branch now that it’s the
sole remaining alternative to results/*; folding it into ?
preserves the exact same early-return behavior with less code.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviews
No reviews of this commit yet — record a verdict below.
Start a review
crates/kernel/ents-model/src/namespace.rs
@@ -181,12 +181,11 @@
let rest = path.strip_prefix("refs/meta/")?;
let tail = if let Some(canonical) = rest.strip_prefix("results/") {
canonical.to_owned()
- } else if let Some(self_run) = rest.strip_prefix("self/") {
+ } else {
+ let self_run = rest.strip_prefix("self/")?;
// refs/meta/self/<member>/<effect>/<short-oid>: drop the member.
let (_, effect_and_oid) = self_run.split_once('/')?;
effect_and_oid.to_owned()
- } else {
- return None;
};
let (effect, short_oid) = tail.split_once('/')?;
if effect.is_empty() || short_oid.is_empty() || short_oid.contains('/') {