Skip to content

Commit

Permalink
chore: simplify strum dependency (#1929)
Browse files Browse the repository at this point in the history
macros are available from derive feature
  • Loading branch information
ss2165 authored Feb 24, 2025
1 parent c4c9c05 commit c642855
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 13 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ serde_json = "1.0.97"
serde_yaml = "0.9.19"
smol_str = "0.3.1"
strum = "0.27.0"
strum_macros = "0.27.0"
thiserror = "2.0.6"
typetag = "0.2.7"
clap = { version = "4.5.4" }
Expand Down
3 changes: 1 addition & 2 deletions hugr-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ petgraph = { workspace = true }
serde_json = { workspace = true }
delegate = { workspace = true }
paste = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
strum = { workspace = true , features = ["derive"]}
semver = { version = "1.0.23", features = ["serde"] }
hugr-model = { version = "0.17.1", path = "../hugr-model", optional = true }
indexmap.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/extension/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::types::{
use crate::utils::sorted_consts;
use crate::{type_row, Extension};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use super::resolution::{resolve_type_extensions, ExtensionResolutionError, WeakExtensionRegistry};
use super::ExtensionRegistry;
Expand Down
4 changes: 2 additions & 2 deletions hugr-core/src/extension/simple_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl<T: MakeOpDef> MakeExtensionOp for T {
}

/// Load an [MakeOpDef] from its name.
/// See [strum_macros::EnumString].
/// See [strum::EnumString].
pub fn try_from_name<T>(name: &OpNameRef, def_extension: &ExtensionId) -> Result<T, OpLoadError>
where
T: std::str::FromStr + MakeOpDef,
Expand Down Expand Up @@ -302,7 +302,7 @@ mod test {

use super::*;
use lazy_static::lazy_static;
use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

#[derive(Clone, Debug, Hash, PartialEq, Eq, EnumIter, IntoStaticStr, EnumString)]
enum DummyEnum {
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 @@ -2,7 +2,7 @@
use std::sync::{Arc, Weak};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use crate::extension::prelude::sum_with_error;
use crate::extension::prelude::{bool_t, string_type, usize_t};
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 @@ -2,7 +2,7 @@
use std::sync::{Arc, Weak};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use super::float_types::float64_type;
use crate::{
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 @@ -20,7 +20,7 @@ use crate::{
};

use lazy_static::lazy_static;
use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

mod const_fold;

Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/collections/array/array_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::sync::{Arc, Weak};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use crate::extension::prelude::{either_type, option_type, usize_t};
use crate::extension::simple_op::{
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/collections/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::sync::{Arc, Weak};
use itertools::Itertools;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use crate::extension::prelude::{either_type, option_type, usize_t};
use crate::extension::resolution::{
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::sync::{Arc, Weak};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use crate::extension::{ConstFold, ConstFoldResult};
use crate::ops::constant::ValueName;
Expand Down
2 changes: 1 addition & 1 deletion hugr-core/src/std_extensions/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::sync::{Arc, Weak};

use strum_macros::{EnumIter, EnumString, IntoStaticStr};
use strum::{EnumIter, EnumString, IntoStaticStr};

use crate::builder::{BuildError, Dataflow};
use crate::extension::TypeDefBound;
Expand Down

0 comments on commit c642855

Please sign in to comment.