From 71d7e36473925902e7912cf30999e2ab56f325d5 Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 26 Jun 2026 14:03:11 +0000 Subject: [PATCH] yeast: Remove dead `BuildCtx::translate_opt` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `translate_opt` was a convenience for the manual_rule! body code, collapsing `Option` to `Option` via `translate`. Since the `@@` raw-capture migration replaced manual_rule! with rule!, no callers remain — the auto-translate prefix handles `Option` captures directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- shared/yeast/src/build.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/shared/yeast/src/build.rs b/shared/yeast/src/build.rs index 7875942f9c1..cda78e69793 100644 --- a/shared/yeast/src/build.rs +++ b/shared/yeast/src/build.rs @@ -186,20 +186,6 @@ impl BuildCtx<'_, C> { None => Err("translate() called on a BuildCtx without a translator handle".into()), } } - - /// Translate an optional capture, returning the first translated id or - /// `None`. Convenience for `?`-quantifier captures (`Option`). - /// - /// If the underlying translation produces multiple ids for a single - /// input, only the first is returned. For most use cases (e.g. - /// translating a single type annotation) this is what you want; if - /// you need all ids, use [`translate`] directly. - pub fn translate_opt>(&mut self, id: Option) -> Result, String> { - match id { - Some(id) => Ok(self.translate(id)?.into_iter().next()), - None => Ok(None), - } - } } impl std::ops::Deref for BuildCtx<'_, C> {