Skip to content

Commit

Permalink
s/set_reqs/add_requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Nov 27, 2024
1 parent 1d0a0d8 commit 1b743a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hugr-core/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl Extension {
}

/// Extend the requirements of this extension with another set of extensions.
pub fn set_reqs(&mut self, extension_reqs: impl Into<ExtensionSet>) {
pub fn add_requirements(&mut self, extension_reqs: impl Into<ExtensionSet>) {
let reqs = mem::take(&mut self.extension_reqs);
self.extension_reqs = reqs.union(extension_reqs.into());
}
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/extension/declarative.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl ExtensionDeclaration {
for o in &self.operations {
o.register(ext, ctx, extension_ref)?;
}
ext.set_reqs(imports.clone());
ext.add_requirements(imports.clone());

Ok(())
},
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/arithmetic/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ lazy_static! {
/// Extension for conversions between integers and floats.
pub static ref EXTENSION: Arc<Extension> = {
Extension::new_arc(EXTENSION_ID, VERSION, |extension, extension_ref| {
extension.set_reqs(
extension.add_requirements(
ExtensionSet::from_iter(vec![
super::int_types::EXTENSION_ID,
super::float_types::EXTENSION_ID,
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/arithmetic/float_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ lazy_static! {
/// Extension for basic float operations.
pub static ref EXTENSION: Arc<Extension> = {
Extension::new_arc(EXTENSION_ID, VERSION, |extension, extension_ref| {
extension.set_reqs(ExtensionSet::singleton(&super::int_types::EXTENSION_ID));
extension.add_requirements(ExtensionSet::singleton(&super::int_types::EXTENSION_ID));
FloatOps::load_all_ops(extension, extension_ref).unwrap();
})
};
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/arithmetic/int_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ lazy_static! {
/// Extension for basic integer operations.
pub static ref EXTENSION: Arc<Extension> = {
Extension::new_arc(EXTENSION_ID, VERSION, |extension, extension_ref| {
extension.set_reqs(ExtensionSet::singleton(&super::int_types::EXTENSION_ID));
extension.add_requirements(ExtensionSet::singleton(&super::int_types::EXTENSION_ID));
IntOpDef::load_all_ops(extension, extension_ref).unwrap();
})
};
Expand Down

0 comments on commit 1b743a1

Please sign in to comment.