diff --git a/module/core/derive_tools/Cargo.toml b/module/core/derive_tools/Cargo.toml index cdf5b512d4..27f9faa37e 100644 --- a/module/core/derive_tools/Cargo.toml +++ b/module/core/derive_tools/Cargo.toml @@ -62,7 +62,7 @@ default = [ "derive_clone_dyn", # "derive_clone_dyn_use_std", - "strum_derive", + "derive_strum", "strum_phf", "derive_from", @@ -102,11 +102,11 @@ full = [ "derive_display", "derive_from_str", - + "derive_clone_dyn", # "derive_clone_dyn_use_std", - "strum_derive", + "derive_strum", "strum_phf", "derive_from", @@ -159,7 +159,7 @@ derive_display = [ "parse-display" ] derive_from_str = [ "parse-display", "parse-display/std", "parse-display/regex" ] # derive_from_str = [ "parse-display", "parse-display/std", "parse-display/regex", "parse-display/once_cell" ] -strum_derive = [ "strum/std", "strum/derive", "strum/strum_macros" ] +derive_strum = [ "strum/std", "strum/derive", "strum/strum_macros" ] strum_phf = [ "strum/std", "strum/phf", "strum/strum_macros" ] # zzz : review features @@ -170,13 +170,12 @@ derive_clone_dyn_use_alloc = [ "derive_clone_dyn", "clone_dyn/use_alloc" ] derive_from = [ "derive_tools_meta/derive_from" ] derive_inner_from = [ "derive_tools_meta/derive_inner_from" ] - +parse_display = [ "parse-display" ] [dependencies] ## external -# derive_more = { version = "~0.99.17", optional = true, default-features = false } -derive_more = { version = "~1.0.0-beta.6", optional = true, default-features = false } +derive_more = { version = "~1.0.0-beta.6", optional = true, default-features = false, features = [ "debug" ] } strum = { version = "~0.25", optional = true, default-features = false } # strum_macros = { version = "~0.25.3", optional = true, default-features = false } parse-display = { version = "~0.8.2", optional = true, default-features = false } diff --git a/module/core/derive_tools/src/lib.rs b/module/core/derive_tools/src/lib.rs index edd8685033..3e29da3f59 100644 --- a/module/core/derive_tools/src/lib.rs +++ b/module/core/derive_tools/src/lib.rs @@ -56,7 +56,7 @@ mod derive_more // #[ cfg( feature = "derive_reflect" ) ] // pub mod reflect; -// use derive_tools_meta::Deref; +// use derive_tools_meta::Deref; // use derive_tools_meta::VariadicFrom; /// Namespace with dependencies. @@ -66,7 +66,7 @@ pub mod dependency { #[ cfg( feature = "derive_more" ) ] pub use ::derive_more; - #[ cfg( feature = "strum" ) ] + #[ cfg( feature = "derive_strum" ) ] pub use ::strum; #[ cfg( feature = "parse_display" ) ] pub use ::parse_display; @@ -125,6 +125,11 @@ pub mod exposed #[ allow( unused_imports ) ] pub use super::derive_more::*; + #[ cfg( feature = "derive_strum" ) ] + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + pub use ::strum::*; + // #[ cfg( all( feature = "derive_more", feature = "derive_add" ) ) ] // #[ doc( inline ) ] // #[ allow( unused_imports ) ] @@ -188,7 +193,7 @@ pub mod exposed // UpperHex, // }; - #[ cfg( feature = "strum" ) ] + #[ cfg( feature = "derive_strum" ) ] #[ doc( inline ) ] #[ allow( unused_imports ) ] pub use ::strum::*; @@ -227,13 +232,17 @@ pub mod exposed #[ cfg( feature = "derive_from" ) ] pub use ::derive_tools_meta::From; + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + #[ cfg( feature = "derive_inner_from" ) ] + pub use ::derive_tools_meta::InnerFrom; + } /// Prelude to use essentials: `use my_module::prelude::*`. #[ cfg( feature = "enabled" ) ] pub mod prelude { - #[ cfg( feature = "derive_clone_dyn" ) ] #[ doc( inline ) ] #[ allow( unused_imports ) ] diff --git a/module/core/derive_tools/tests/inc/basic_test.rs b/module/core/derive_tools/tests/inc/basic_test.rs index 364383fa1e..f83df41abe 100644 --- a/module/core/derive_tools/tests/inc/basic_test.rs +++ b/module/core/derive_tools/tests/inc/basic_test.rs @@ -84,7 +84,7 @@ tests_impls! #[ cfg( all( feature = "strum", feature = "strum_derive" ) ) ] fn enum_with_strum() { - use the_module::*; + use the_module::{ EnumIter, IntoEnumIterator }; #[ derive( EnumIter, Debug, PartialEq ) ] enum Foo diff --git a/module/core/derive_tools/tests/tests.rs b/module/core/derive_tools/tests/tests.rs index 31961842a8..766eadcfe7 100644 --- a/module/core/derive_tools/tests/tests.rs +++ b/module/core/derive_tools/tests/tests.rs @@ -4,5 +4,6 @@ use derive_tools as the_module; #[ allow( unused_imports ) ] use test_tools::exposed::*; +#[ cfg( feature = "enabled" ) ] mod inc; diff --git a/module/core/wtools/Cargo.toml b/module/core/wtools/Cargo.toml index 25597d8ea4..78c0329a51 100644 --- a/module/core/wtools/Cargo.toml +++ b/module/core/wtools/Cargo.toml @@ -300,7 +300,7 @@ derive_is_variant = [ "derive", "derive_tools/derive_is_variant" ] derive_unwrap = [ "derive", "derive_tools/derive_unwrap" ] # derive_convert_case = [ "derive", "derive_tools/derive_convert_case" ] -derive_strum = [ "derive", "derive_tools/strum_derive" ] +derive_strum = [ "derive", "derive_tools/derive_strum" ] derive_strum_phf = [ "derive", "derive_tools/strum_phf" ] derive_display = [ "derive", "derive_tools/derive_display", "parse-display" ]