@@ -7,7 +7,7 @@ pub mod serialize;
7
7
pub mod validate;
8
8
pub mod views;
9
9
10
- use std:: collections:: { HashMap , VecDeque } ;
10
+ use std:: collections:: VecDeque ;
11
11
use std:: iter;
12
12
13
13
pub ( crate ) use self :: hugrmut:: HugrMut ;
@@ -197,9 +197,9 @@ impl Hugr {
197
197
}
198
198
199
199
/// Infer extension requirements and add new information to `op_types` field
200
- pub fn infer_extensions (
201
- & mut self ,
202
- ) -> Result < HashMap < ( Node , Direction ) , ExtensionSet > , InferExtensionError > {
200
+ ///
201
+ /// See [`infer_extensions`] for details on the "closure" value
202
+ pub fn infer_extensions ( & mut self ) -> Result < ExtensionSolution , InferExtensionError > {
203
203
let ( solution, extension_closure) = infer_extensions ( self ) ?;
204
204
self . instantiate_extensions ( solution) ;
205
205
Ok ( extension_closure)
@@ -214,10 +214,10 @@ impl Hugr {
214
214
. filter ( |( ( _, dir) , _) | * dir == Direction :: Incoming )
215
215
{
216
216
let nodetype = self . op_types . try_get_mut ( node. index ) . unwrap ( ) ;
217
- match nodetype. signature ( ) {
217
+ match & nodetype. input_extensions {
218
218
None => nodetype. input_extensions = Some ( input_extensions. clone ( ) ) ,
219
219
Some ( existing_ext_reqs) => {
220
- debug_assert_eq ! ( existing_ext_reqs. input_extensions , * input_extensions)
220
+ debug_assert_eq ! ( existing_ext_reqs, input_extensions)
221
221
}
222
222
}
223
223
}
0 commit comments