Skip to content

Commit a534de4

Browse files
committed
node: take context object as parameter to CommitNode::unfinalize_types
Very short change, because this function is never called or tested anywhere.
1 parent dec28f3 commit a534de4

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/node/commit.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,16 @@ impl<J: Jet> CommitNode<J> {
187187
}
188188

189189
/// Convert a [`CommitNode`] back to a [`ConstructNode`] by redoing type inference
190-
pub fn unfinalize_types<'brand>(&self) -> Result<Arc<ConstructNode<'brand, J>>, types::Error> {
191-
struct UnfinalizeTypes<'brand, J: Jet> {
192-
inference_context: types::Context<'brand>,
190+
pub fn unfinalize_types<'brand>(
191+
&self,
192+
inference_context: &types::Context<'brand>,
193+
) -> Result<Arc<ConstructNode<'brand, J>>, types::Error> {
194+
struct UnfinalizeTypes<'a, 'brand, J: Jet> {
195+
inference_context: &'a types::Context<'brand>,
193196
phantom: PhantomData<J>,
194197
}
195198

196-
impl<'brand, J: Jet> Converter<Commit<J>, Construct<'brand, J>> for UnfinalizeTypes<'brand, J> {
199+
impl<'brand, J: Jet> Converter<Commit<J>, Construct<'brand, J>> for UnfinalizeTypes<'_, 'brand, J> {
197200
type Error = types::Error;
198201
fn convert_witness(
199202
&mut self,
@@ -227,14 +230,14 @@ impl<J: Jet> CommitNode<J> {
227230
.map_disconnect(|maybe_node| maybe_node.as_ref().map(|node| node.arrow()));
228231
let inner = inner.disconnect_as_ref(); // lol sigh rust
229232
Ok(ConstructData::new(Arrow::from_inner(
230-
&self.inference_context,
233+
self.inference_context,
231234
inner,
232235
)?))
233236
}
234237
}
235238

236239
self.convert::<MaxSharing<Commit<J>>, _, _>(&mut UnfinalizeTypes {
237-
inference_context: types::Context::new(),
240+
inference_context,
238241
phantom: PhantomData,
239242
})
240243
}

0 commit comments

Comments
 (0)