diff --git a/module/core/variadic_from/Readme.md b/module/core/variadic_from/Readme.md index 277157b469..f6bd50aa1c 100644 --- a/module/core/variadic_from/Readme.md +++ b/module/core/variadic_from/Readme.md @@ -12,10 +12,11 @@ Variadic from ```rust -use variadic_from::exposed::*; - +#[ cfg( all(feature = "enabled", feature = "type_variadic_from" ) )] fn main() { + use variadic_from::exposed::*; + #[ derive( Debug, PartialEq, Default, VariadicFrom ) ] struct StructNamedFields { @@ -34,8 +35,10 @@ fn main() let got : StructNamedFields = ( 13, 14 ).to(); let exp = StructNamedFields{ a : 13, b : 14 }; assert_eq!( got, exp ); - } + +#[ cfg( not( all(feature = "enabled", feature = "type_variadic_from" ) ) ) ] +fn main(){} ``` ### To add to your project diff --git a/module/core/variadic_from/examples/variadic_from_trivial.rs b/module/core/variadic_from/examples/variadic_from_trivial.rs index 5909b238ab..d10d259566 100644 --- a/module/core/variadic_from/examples/variadic_from_trivial.rs +++ b/module/core/variadic_from/examples/variadic_from_trivial.rs @@ -1,8 +1,13 @@ //! qqq : write proper description -use variadic_from::exposed::*; +#[ cfg( not( all(feature = "enabled", feature = "type_variadic_from" ) ) ) ] +fn main(){} + +#[ cfg( all(feature = "enabled", feature = "type_variadic_from" ) )] fn main() { + use variadic_from::*; + #[ derive( Debug, PartialEq, Default, VariadicFrom ) ] struct StructNamedFields { @@ -22,4 +27,4 @@ fn main() let exp = StructNamedFields{ a : 13, b : 14 }; assert_eq!( got, exp ); -} +} \ No newline at end of file diff --git a/module/core/variadic_from/tests/variadic_from_tests.rs b/module/core/variadic_from/tests/variadic_from_tests.rs index 0474ad11d6..2b5d216700 100644 --- a/module/core/variadic_from/tests/variadic_from_tests.rs +++ b/module/core/variadic_from/tests/variadic_from_tests.rs @@ -4,5 +4,6 @@ use variadic_from as the_module; use test_tools::exposed::*; // #[ path = "inc.rs" ] +#[ cfg( feature = "enabled" ) ] mod inc;