From eff94fb4afdc67d9734cd4137bc1fad2c267c201 Mon Sep 17 00:00:00 2001 From: Weksa Date: Tue, 10 Nov 2026 03:25:44 +0000 Subject: [PATCH] Pin LoweringInput::of's privacy with the right arity; scene() doc points to scene_read() Co-Authored-By: Claude Sonnet 5.5 --- crates/weksa/src/validate.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/weksa/src/validate.rs b/crates/weksa/src/validate.rs index d8989ca..a74066f 100644 --- a/crates/weksa/src/validate.rs +++ b/crates/weksa/src/validate.rs @@ -609,11 +609,13 @@ pub enum SceneRead { /// call, so the second fails for that call and nothing else. /// /// ``` -/// fn build(p: &weksa::packet::Packet) { let _ = p; } +/// fn build(p: &weksa::packet::Packet, item: &weksa::CorpusItem) { let _ = (p, item); } /// ``` /// /// ```compile_fail -/// fn build(p: &weksa::packet::Packet) { let _ = weksa::LoweringInput::of(p); } +/// fn build(p: &weksa::packet::Packet, item: &weksa::CorpusItem) { +/// let _ = weksa::LoweringInput::of(p, item); +/// } /// ``` /// /// A lowering view is never read from bytes: `Deserialize` would let a caller @@ -752,8 +754,9 @@ impl LoweringInput { pub fn stance(&self) -> &Stance { &self.stance } - /// The features of the scene relation from the speaker to the addressee; - /// empty until `with_scene`, or when the scene holds none. + /// The features of the scene relation from the speaker to the addressee. + /// Empty for every [`SceneRead`] but `Selected` (and for a selected + /// relation that has no features): ask [`scene_read`](Self::scene_read) which. pub fn scene(&self) -> &[FeatureValue] { match &self.scene { SceneRead::Selected { features, .. } => features,