Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTO : Forward from program_tools_v1 to alpha #1356

Merged
merged 60 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
571e5a5
regenerate readme
Wandalen May 27, 2024
55609bb
macro_tools : attr_props example
Wandalen May 27, 2024
fcd8379
derive_tools : utilizing attr props
Wandalen May 27, 2024
59ee6f6
macro_tools : attr_props refactoring
Wandalen May 27, 2024
e465730
macro_tools : attr_props refactoring and examples
Wandalen May 28, 2024
d40ba40
macro_tools : attr_props refactoring and examples
Wandalen May 28, 2024
607263f
macro_tools : attr_props refactoring and examples
Wandalen May 28, 2024
74fd9d4
macro_tools : evolve props
Wandalen May 28, 2024
56df95f
macro_tools : evolve props
Wandalen May 28, 2024
1e6a96b
derive_tools : from : item-level config
Wandalen May 28, 2024
28011e3
derive_tools : from : item-level config
Wandalen May 28, 2024
c0d0133
derive_tools : from : hint working
Wandalen May 28, 2024
11f3243
macro_tools : property singletone
Wandalen May 28, 2024
cf6247c
macro_tools : property singletone
Wandalen May 28, 2024
274d2ff
derive_tools : property hint -
Wandalen May 28, 2024
b831eab
former : property hint -
Wandalen May 28, 2024
989e9fd
former : property hint -
Wandalen May 28, 2024
7aaa2a7
former : property hint -
Wandalen May 28, 2024
0b9968c
former : property hint -
Wandalen May 28, 2024
b095bb3
macro_tools : cleaning
Wandalen May 28, 2024
2765144
former : shorter property custom
Wandalen May 28, 2024
31cdcc0
former : shorter property custom
Wandalen May 28, 2024
25629e9
former : cleaning
Wandalen May 28, 2024
6ac36ec
former : cleaning
Wandalen May 29, 2024
cfbedf0
macro_tools : better documentation
Wandalen May 29, 2024
a8b2223
macroses : use AttributePropertyOptionalSingletone instead of Attribu…
Wandalen May 29, 2024
40a707e
macroses : per-field assign to make possible usage of several attribu…
Wandalen May 29, 2024
7069a4d
macroses : per-field assign to make possible usage of several attribu…
Wandalen May 29, 2024
5b6407e
macroses : per-field assign to make possible usage of several attribu…
Wandalen May 29, 2024
41b59fd
macroses : per-field assign to make possible usage of several attribu…
Wandalen May 29, 2024
2ac0758
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
c6420cc
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
c4a00f0
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
2759f92
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
023e5f7
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
1a227a3
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
ff77b3f
derive_tools, former: implementing ComponentAssign for all attributes
Wandalen May 30, 2024
dfd6932
macro_tools : defalt markers for props
Wandalen May 30, 2024
d6cc5de
all derives : avoid checking is attribute known
Wandalen May 30, 2024
97a358c
derive_tools: refactor from
Wandalen May 30, 2024
af609be
derive_tools: tasks
Wandalen May 30, 2024
1dfd7e5
merge
Wandalen May 30, 2024
ff6866d
former_types-v2.2.0
Wandalen May 30, 2024
31530b2
macro_tools-v0.27.0
Wandalen May 30, 2024
964b934
derive_tools_meta-v0.22.0
Wandalen May 30, 2024
44f4488
clone_dyn_meta-v0.17.0
Wandalen May 30, 2024
f765b74
variadic_from-v0.18.0
Wandalen May 30, 2024
5f402e8
clone_dyn-v0.17.0
Wandalen May 30, 2024
11629dd
derive_tools-v0.23.0
Wandalen May 30, 2024
681751e
mod_interface_meta-v0.20.0
Wandalen May 30, 2024
154217f
error_tools-v0.14.0
Wandalen May 30, 2024
9a66dfb
mod_interface-v0.20.0
Wandalen May 30, 2024
7bb81fd
proper_path_tools-v0.6.0
Wandalen May 30, 2024
15dc0dc
former_meta-v2.1.0
Wandalen May 30, 2024
fcc5a89
former-v2.1.0
Wandalen May 30, 2024
f19f521
strs_tools-v0.13.0
Wandalen May 30, 2024
0db6868
wca-v0.17.0
Wandalen May 30, 2024
ce19a16
process_tools-v0.5.0
Wandalen May 30, 2024
22838e5
crates_tools-v0.10.0
Wandalen May 30, 2024
60c4a80
willbe-v0.11.0
Wandalen May 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ default-features = false
## derive

[workspace.dependencies.derive_tools]
version = "~0.22.0"
version = "~0.23.0"
path = "module/core/derive_tools"
default-features = false
features = [ "enabled" ]

[workspace.dependencies.derive_tools_meta]
version = "~0.21.0"
version = "~0.22.0"
path = "module/core/derive_tools_meta"
default-features = false
features = [ "enabled" ]
Expand Down Expand Up @@ -146,19 +146,19 @@ path = "module/alias/fundamental_data_type"
default-features = false

[workspace.dependencies.variadic_from]
version = "~0.17.0"
version = "~0.18.0"
path = "module/core/variadic_from"
default-features = false
features = [ "enabled" ]

[workspace.dependencies.clone_dyn]
version = "~0.16.0"
version = "~0.17.0"
path = "module/core/clone_dyn"
default-features = false
features = [ "enabled" ]

[workspace.dependencies.clone_dyn_meta]
version = "~0.16.0"
version = "~0.17.0"
path = "module/core/clone_dyn_meta"
features = [ "enabled" ]

Expand Down Expand Up @@ -200,7 +200,7 @@ path = "module/core/for_each"
default-features = false

[workspace.dependencies.former]
version = "~2.0.0"
version = "~2.1.0"
path = "module/core/former"
default-features = false

Expand All @@ -210,12 +210,12 @@ version = "=2.0.0"
default-features = false

[workspace.dependencies.former_meta]
version = "~2.0.0"
version = "~2.1.0"
path = "module/core/former_meta"
default-features = false

[workspace.dependencies.former_types]
version = "~2.1.0"
version = "~2.2.0"
path = "module/core/former_types"
default-features = false

Expand All @@ -229,12 +229,12 @@ version = "~0.7.0"
path = "module/core/impls_index_meta"

[workspace.dependencies.mod_interface]
version = "~0.19.0"
version = "~0.20.0"
path = "module/core/mod_interface"
default-features = false

[workspace.dependencies.mod_interface_meta]
version = "~0.19.0"
version = "~0.20.0"
path = "module/core/mod_interface_meta"
default-features = false

Expand All @@ -260,7 +260,7 @@ default-features = false
## macro tools

[workspace.dependencies.macro_tools]
version = "~0.26.0"
version = "~0.27.0"
path = "module/core/macro_tools"
default-features = false

Expand Down Expand Up @@ -314,7 +314,7 @@ default-features = false
## error

[workspace.dependencies.error_tools]
version = "~0.13.0"
version = "~0.14.0"
path = "module/core/error_tools"
default-features = false

Expand All @@ -326,7 +326,7 @@ path = "module/alias/werror"
## string tools

[workspace.dependencies.strs_tools]
version = "~0.12.0"
version = "~0.13.0"
path = "module/core/strs_tools"
default-features = false

Expand All @@ -348,15 +348,15 @@ path = "module/alias/file_tools"
default-features = false

[workspace.dependencies.proper_path_tools]
version = "~0.5.0"
version = "~0.6.0"
path = "module/core/proper_path_tools"
default-features = false


## process tools

[workspace.dependencies.process_tools]
version = "~0.4.0"
version = "~0.5.0"
path = "module/core/process_tools"
default-features = false

Expand Down Expand Up @@ -403,7 +403,7 @@ default-features = false
## ca

[workspace.dependencies.wca]
version = "~0.16.0"
version = "~0.17.0"
path = "module/move/wca"


Expand All @@ -417,7 +417,7 @@ path = "module/move/wcensor"
## willbe

[workspace.dependencies.willbe]
version = "~0.10.0"
version = "~0.11.0"
path = "module/move/willbe"


Expand Down Expand Up @@ -457,7 +457,7 @@ version = "~0.5.0"
path = "module/move/deterministic_rand"

[workspace.dependencies.crates_tools]
version = "~0.9.0"
version = "~0.10.0"
path = "module/move/crates_tools"


Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Collection of general purpose tools for solving problems. Fundamentally extend t
| [clone_dyn_meta](module/core/clone_dyn_meta) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_clone_dyn_meta_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_meta_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_clone_dyn_meta_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_meta_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/clone_dyn_meta) | |
| [derive_tools_meta](module/core/derive_tools_meta) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_derive_tools_meta_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_derive_tools_meta_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_derive_tools_meta_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_derive_tools_meta_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/derive_tools_meta) | |
| [clone_dyn](module/core/clone_dyn) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_clone_dyn_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_clone_dyn_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/clone_dyn) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fclone_dyn%2Fexamples%2Fclone_dyn_trivial.rs,RUN_POSTFIX=--example%20clone_dyn_trivial/https://github.com/Wandalen/wTools) |
| [collection_tools](module/core/collection_tools) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_collection_tools_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_collection_tools_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/collection_tools) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fcollection_tools%2Fexamples%2Fcollection_tools_trivial.rs,RUN_POSTFIX=--example%20collection_tools_trivial/https://github.com/Wandalen/wTools) |
| [variadic_from](module/core/variadic_from) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_variadic_from_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_variadic_from_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_variadic_from_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_variadic_from_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/variadic_from) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fvariadic_from%2Fexamples%2Fvariadic_from_trivial.rs,RUN_POSTFIX=--example%20variadic_from_trivial/https://github.com/Wandalen/wTools) |
| [derive_tools](module/core/derive_tools) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_derive_tools_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_derive_tools_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_derive_tools_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_derive_tools_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/derive_tools) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fderive_tools%2Fexamples%2Fderive_tools_trivial.rs,RUN_POSTFIX=--example%20derive_tools_trivial/https://github.com/Wandalen/wTools) |
| [collection_tools](module/core/collection_tools) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_collection_tools_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_collection_tools_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/collection_tools) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fcollection_tools%2Fexamples%2Fcollection_tools_trivial.rs,RUN_POSTFIX=--example%20collection_tools_trivial/https://github.com/Wandalen/wTools) |
| [former_types](module/core/former_types) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_former_types_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_former_types_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_former_types_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_former_types_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/former_types) | [![Open in Gitpod](https://raster.shields.io/static/v1?label=&message=try&color=eee)](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fformer_types%2Fexamples%2Fformer_types_trivial.rs,RUN_POSTFIX=--example%20former_types_trivial/https://github.com/Wandalen/wTools) |
| [former_meta](module/core/former_meta) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_former_meta_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_former_meta_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_former_meta_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_former_meta_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/former_meta) | |
| [impls_index_meta](module/core/impls_index_meta) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_impls_index_meta_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_impls_index_meta_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_impls_index_meta_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_impls_index_meta_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/impls_index_meta) | |
| [mod_interface_meta](module/core/mod_interface_meta) | [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_mod_interface_meta_push.yml?label=&branch=master)](https://github.com/Wandalen/wTools/actions/workflows/module_mod_interface_meta_push.yml?query=branch%3Amaster) | [![rust-status](https://img.shields.io/github/actions/workflow/status/Wandalen/wTools/module_mod_interface_meta_push.yml?label=&branch=alpha)](https://github.com/Wandalen/wTools/actions/workflows/module_mod_interface_meta_push.yml?query=branch%3Aalpha) | [![docs.rs](https://raster.shields.io/static/v1?label=&message=docs&color=eee)](https://docs.rs/mod_interface_meta) | |
Expand Down
3 changes: 3 additions & 0 deletions debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[program_tools_v1 0b9968c19] former : property hint -
1 file changed, 1 insertion(+)
Already up to date.
2 changes: 1 addition & 1 deletion module/core/clone_dyn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clone_dyn"
version = "0.16.0"
version = "0.17.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <wandalen@obox.systems>",
Expand Down
2 changes: 1 addition & 1 deletion module/core/clone_dyn_meta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clone_dyn_meta"
version = "0.16.0"
version = "0.17.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <wandalen@obox.systems>",
Expand Down
2 changes: 1 addition & 1 deletion module/core/derive_tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "derive_tools"
version = "0.22.0"
version = "0.23.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <wandalen@obox.systems>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,3 @@ pub enum GetData
// == end of generated

include!( "./only_test/from_inner_variants.rs" );

// xxx2 : implement attribute `#[ from( off ) ]`
//
// #[ derive( Debug, PartialEq, From ) ]
// // #[ debug ]
// pub enum GetData< 'a, T >
// where
// T : ToString + ?Sized,
// {
// FromBin( &'static [ u8 ] ),
// FromT( &'a T ),
// }
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ pub enum GetData
{
Nothing,
Nothing2,
#[ from( off ) ]
FromString( String ),
#[ from( off ) ]
FromString2( String ),
#[ from( off ) ]
FromPair( String, String ),
#[ from( off ) ]
FromPair2( String, String ),
FromBin( &'static [ u8 ] ),
Nothing3,
Expand Down Expand Up @@ -38,20 +42,4 @@ impl From< ( String, String ) > for GetData

// == end of generated

#[ test ]
fn variant_from()
{

let got : GetData = From::from( &b"abc"[ .. ] );
let exp = GetData::FromBin( b"abc" );
a_id!( got, exp );

let got : GetData = From::from( "abc".to_string() );
let exp = GetData::FromString2( "abc".to_string() );
a_id!( got, exp );

let got : GetData = From::from( ( "a".to_string(), "b".to_string() ) );
let exp = GetData::FromPair2( "a".to_string(), "b".to_string() );
a_id!( got, exp );

}
include!( "./only_test/from_inner_variants_duplicates.rs" );
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#![ allow( dead_code ) ]
#[ allow( unused_imports ) ]
use super::*;

#[ derive( Debug, PartialEq, the_module::From ) ]
// #[ debug ]
pub enum GetData
{
Nothing,
Nothing2,
#[ from( off ) ]
FromString( String ),
FromString2( String ),
#[ from( off ) ]
FromPair( String, String ),
FromPair2( String, String ),
FromBin( &'static [ u8 ] ),
Nothing3,
}

// == begin of generated

// == end of generated

include!( "./only_test/from_inner_variants_duplicates.rs" );
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#![ allow( dead_code ) ]
#[ allow( unused_imports ) ]
use super::*;

#[ derive( Debug, PartialEq, the_module::From ) ]
#[ from( off ) ]
// #[ debug ]
pub enum GetData
{
Nothing,
Nothing2,
FromString( String ),
#[ from( on ) ]
// #[ from( debug ) ]
FromString2( String ),
FromPair( String, String ),
#[ from( on ) ]
FromPair2( String, String ),
#[ from( on ) ]
FromBin( &'static [ u8 ] ),
Nothing3,
}

// == begin of generated
// == end of generated

include!( "./only_test/from_inner_variants_duplicates.rs" );
10 changes: 7 additions & 3 deletions module/core/derive_tools/tests/inc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ mod from_inner_multiple_test;
mod from_inner_variants_manual;
#[ cfg( feature = "derive_from" ) ]
mod from_inner_variants_derive;

#[ cfg( feature = "derive_from" ) ]
mod from_inner_variants_duplicates_all_off;
#[ cfg( feature = "derive_from" ) ]
mod from_inner_variants_duplicates;
mod from_inner_variants_duplicates_some_off;
#[ cfg( feature = "derive_from" ) ]
mod from_inner_variants_duplicates_some_off_default_off;

#[ cfg( feature = "derive_from" ) ]
mod from_inner_variants_generics;
#[ cfg( feature = "derive_from" ) ]
Expand All @@ -92,5 +98,3 @@ mod inner_from_multiple_named_test;
mod inner_from_unit_test;
#[ cfg( feature = "derive_inner_from" ) ]
mod inner_from_multiple_test;

// xxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#[ allow( unused_imports ) ]
use super::*;

#[ test ]
fn variant_from_duplicates()
{

let got : GetData = From::from( &b"abc"[ .. ] );
let exp = GetData::FromBin( b"abc" );
a_id!( got, exp );

let got : GetData = From::from( "abc".to_string() );
let exp = GetData::FromString2( "abc".to_string() );
a_id!( got, exp );

let got : GetData = From::from( ( "a".to_string(), "b".to_string() ) );
let exp = GetData::FromPair2( "a".to_string(), "b".to_string() );
a_id!( got, exp );

}
7 changes: 5 additions & 2 deletions module/core/derive_tools_meta/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "derive_tools_meta"
version = "0.21.0"
version = "0.22.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <wandalen@obox.systems>",
Expand Down Expand Up @@ -63,7 +63,10 @@ derive_variadic_from = []
[dependencies]
macro_tools = { workspace = true, features = [ "full" ] }
iter_tools = { workspace = true, features = [ "full" ] }
# xxx : qqq : for Petro : optimize features set
former_types = { workspace = true, features = [ "enabled", "types_component_assign" ] }
const_format = { version = "0.2.32" }

# qqq : optimize features set

[dev-dependencies]
test_tools = { workspace = true }
1 change: 0 additions & 1 deletion module/core/derive_tools_meta/src/derive/as_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pub fn as_ref( input : proc_macro::TokenStream ) -> Result< proc_macro2::TokenSt
let original_input = input.clone();
let parsed = syn::parse::< syn::ItemStruct >( input )?;
let has_debug = attr::has_debug( parsed.attrs.iter() )?;

let field_type = item_struct::first_field_type( &parsed )?;
let item_name = &parsed.ident;

Expand Down
Loading
Loading