Skip to content

Commit

Permalink
Merge pull request #1267 from SRetip/variadic_from_fix
Browse files Browse the repository at this point in the history
READY : variadic_from fix
  • Loading branch information
Wandalen authored Mar 29, 2024
2 parents ddd2b89 + f3b9ae3 commit 70613e1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 6 additions & 3 deletions module/core/variadic_from/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ Variadic from
<!-- {{# generate.module{} #}} -->

```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
{
Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions module/core/variadic_from/examples/variadic_from_trivial.rs
Original file line number Diff line number Diff line change
@@ -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
{
Expand All @@ -22,4 +27,4 @@ fn main()
let exp = StructNamedFields{ a : 13, b : 14 };
assert_eq!( got, exp );

}
}
1 change: 1 addition & 0 deletions module/core/variadic_from/tests/variadic_from_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ use variadic_from as the_module;
use test_tools::exposed::*;

// #[ path = "inc.rs" ]
#[ cfg( feature = "enabled" ) ]
mod inc;

0 comments on commit 70613e1

Please sign in to comment.