diff --git a/hugr-core/src/extension.rs b/hugr-core/src/extension.rs index 22e1bb3b4..e1674afac 100644 --- a/hugr-core/src/extension.rs +++ b/hugr-core/src/extension.rs @@ -52,8 +52,9 @@ pub struct ExtensionRegistry { /// A flag indicating whether the current set of extensions has been /// validated. /// - /// This is used to avoid re-validating the extensions every time they are - /// used, and is set to `false` whenever a new extension is added. + /// This is used to avoid re-validating the extensions every time the + /// registry is validated, and is set to `false` whenever a new extension is + /// added. valid: AtomicBool, } diff --git a/hugr-core/src/extension/resolution.rs b/hugr-core/src/extension/resolution.rs index db2ad12ff..3ccaeb857 100644 --- a/hugr-core/src/extension/resolution.rs +++ b/hugr-core/src/extension/resolution.rs @@ -23,7 +23,7 @@ mod ops; mod types; mod types_mut; -pub(crate) use ops::{collect_op_extensions, resolve_op_extensions}; +pub(crate) use ops::{collect_op_extension, resolve_op_extensions}; pub(crate) use types::{collect_op_types_extensions, collect_signature_exts}; pub(crate) use types_mut::resolve_op_types_extensions; diff --git a/hugr-core/src/extension/resolution/ops.rs b/hugr-core/src/extension/resolution/ops.rs index 76b290434..42e3954dd 100644 --- a/hugr-core/src/extension/resolution/ops.rs +++ b/hugr-core/src/extension/resolution/ops.rs @@ -20,12 +20,12 @@ use crate::Node; /// invalidated if the original `Arc` is dropped. On such cases, we /// return an error with the missing extension names. /// -/// # Attributes +/// # Parameters /// /// - `node`: The node where the operation is located, if available. This is /// used to provide context in the error message. /// - `op`: The operation to collect the extensions from. -pub(crate) fn collect_op_extensions( +pub(crate) fn collect_op_extension( node: Option, op: &OpType, ) -> Result>, ExtensionCollectionError> { diff --git a/hugr-core/src/extension/resolution/types_mut.rs b/hugr-core/src/extension/resolution/types_mut.rs index 554b73472..7f8f16f4c 100644 --- a/hugr-core/src/extension/resolution/types_mut.rs +++ b/hugr-core/src/extension/resolution/types_mut.rs @@ -13,12 +13,12 @@ use crate::types::type_row::TypeRowBase; use crate::types::{MaybeRV, Signature, SumType, TypeArg, TypeBase, TypeEnum}; use crate::Node; -/// Replace the dangling extension pointer in the [`CustomType`]s inside a -/// signature with a valid pointer to the extension in the `extensions` +/// Replace the dangling extension pointer in the [`CustomType`]s inside an +/// optype with a valid pointer to the extension in the `extensions` /// registry. /// /// When a pointer is replaced, the extension is added to the -/// `used_extensions` registry and the new type definition is returned. +/// `used_extensions` registry. /// /// This is a helper function used right after deserializing a Hugr. pub fn resolve_op_types_extensions( diff --git a/hugr-core/src/ops.rs b/hugr-core/src/ops.rs index 7815d7ea1..05f854589 100644 --- a/hugr-core/src/ops.rs +++ b/hugr-core/src/ops.rs @@ -10,7 +10,7 @@ pub mod sum; pub mod tag; pub mod validate; use crate::extension::resolution::{ - collect_op_extensions, collect_op_types_extensions, ExtensionCollectionError, + collect_op_extension, collect_op_types_extensions, ExtensionCollectionError, }; use crate::extension::simple_op::MakeExtensionOp; use crate::extension::{ExtensionId, ExtensionRegistry, ExtensionSet}; @@ -313,7 +313,7 @@ impl OpType { } } - /// Returns a register with all the extensions required by the operation. + /// Returns a registry with all the extensions required by the operation. /// /// This includes the operation extension in [`OpType::extension_id`], and any /// extension required by the operation's signature types. @@ -321,7 +321,7 @@ impl OpType { // Collect extensions on the types. let mut reg = collect_op_types_extensions(None, self)?; // And on the operation definition itself. - if let Some(ext) = collect_op_extensions(None, self)? { + if let Some(ext) = collect_op_extension(None, self)? { reg.register_updated(ext); } Ok(reg)