Skip to content

Commit

Permalink
Merge pull request #1356 from Wandalen/program_tools_v1
Browse files Browse the repository at this point in the history
AUTO : Forward from program_tools_v1 to alpha
  • Loading branch information
Wandalen authored May 30, 2024
2 parents 4f18593 + 60c4a80 commit 07d22ed
Show file tree
Hide file tree
Showing 80 changed files with 2,960 additions and 1,348 deletions.
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 <[email protected]>",
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 <[email protected]>",
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 <[email protected]>",
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 <[email protected]>",
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

0 comments on commit 07d22ed

Please sign in to comment.