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 alpha to beta #1474

Open
wants to merge 37 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9ae6281
Merge pull request #1436 from Wandalen/beta
Wandalen Aug 30, 2024
4a8e0c3
clean
Wandalen Nov 5, 2024
fa11a44
Merge branch 'alpha' of github.com:Wandalen/wTools into alpha
Wandalen Nov 5, 2024
99b1fb0
AUTO : Forward from refactoring_2 to alpha (#1477)
wtools-bot Nov 6, 2024
e429927
READY: (alpha/willbe): `.publish` and `.publish.diff` new options (#1…
Barsik-sus Nov 6, 2024
4f99916
chore: resolve warnings (#1473)
Barsik-sus Nov 6, 2024
073a878
AUTO : Forward from refactoring_3 to alpha (#1480)
wtools-bot Nov 7, 2024
857016f
READY: (willbe): Add Test for Emulation of Publication Sequence (#1481)
Barsik-sus Nov 8, 2024
ef63270
NOT READY : Assistant: OpenAI (#1478)
InAnYan Nov 8, 2024
e54ed4f
.
Wandalen Nov 8, 2024
e9e56b3
Merge branch 'alpha' into refactoring_4
Wandalen Nov 8, 2024
4c17fa5
assistant : newer version of dependency
Wandalen Nov 10, 2024
9beca47
test_tools : standalone mem_tools
Wandalen Nov 10, 2024
e33a2b7
Merge pull request #1483 from Wandalen/refactoring_4
Wandalen Nov 11, 2024
c055473
Fix assistant (#1484)
InAnYan Nov 11, 2024
9370621
Fix for `format_tools` for overflow subtract (#1490)
InAnYan Nov 14, 2024
5b52e5f
publishing deterministic_rand
Wandalen Nov 15, 2024
d3bf267
READY : Continue work on assistant (#1489)
InAnYan Nov 18, 2024
ea86324
READY : `format_tools`: limit table width (#1494)
InAnYan Nov 22, 2024
3620512
READY : `format_tools` - alternative API function (#1496)
InAnYan Nov 22, 2024
9f6ec87
READY : Agents framework design draft (#1488)
InAnYan Nov 22, 2024
d762865
READY : `format_tools` test for dyn. container of dyn. struct (#1497)
InAnYan Nov 22, 2024
039445d
Add maximum table width to assistants CLI (#1499)
InAnYan Dec 2, 2024
4330d03
NOT READY : Agents implementation (#1498)
InAnYan Dec 3, 2024
2e7e3de
READY : Test task Google Sheets CLI (#1495)
sevabakutov Dec 3, 2024
f8ab967
READY : Agents (#1500)
InAnYan Dec 3, 2024
958c514
Remove doc comment (#1502)
InAnYan Dec 4, 2024
2d5382e
Add documentation to `format_tools` (#1501)
InAnYan Dec 4, 2024
7e9afae
READY: Fix module/core/process_tools/src/process.rs (#1508)
sevabakutov Dec 4, 2024
8fdf362
dependecies fix (#1509)
sevabakutov Dec 4, 2024
39907f7
READY: (wca): qqq (#1492)
Barsik-sus Dec 4, 2024
40f5e25
Fix gspread error handling (#1512)
sevabakutov Dec 11, 2024
9c2cbf4
secret description fixed (#1510)
sevabakutov Dec 11, 2024
b0f9911
NOT READY: (willbe): `qqq` processing (#1511)
Barsik-sus Dec 11, 2024
33f1d1a
NOT READY : fix willbe (#1479)
SRetip Dec 16, 2024
b0a22e6
FIX GSPREAD: fix gspread structure (#1516)
sevabakutov Dec 30, 2024
5e94a93
Gspread fix readme (#1515)
sevabakutov Dec 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 38 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ discord_url = "https://discord.gg/m3YfbXpUUY"
# Source :: https://github.com/obox-systems/conventions/blob/master/code_style.md#lints-and-warnings

# Denies non-idiomatic code for Rust 2018 edition.
rust_2018_idioms = "deny"
rust_2018_idioms = { level = "deny", priority = -1 }
# Denies using features that may break in future Rust versions.
future_incompatible = "deny"
future_incompatible = { level = "deny", priority = -1 }
# Warns if public items lack documentation.
missing_docs = "warn"
# Warns for public types not implementing Debug.
Expand All @@ -41,9 +41,9 @@ unsafe-code = "warn"

[workspace.lints.clippy]
# Denies restrictive lints, limiting certain language features/patterns.
restriction = "warn"
#restriction = { level = "deny", priority = -1 }
# Denies pedantic lints, enforcing strict coding styles and conventions.
pedantic = "warn"
pedantic = { level = "warn", priority = -1 }
# Denies undocumented unsafe blocks.
undocumented_unsafe_blocks = "deny"
# xxx : check
Expand Down Expand Up @@ -492,7 +492,7 @@ version = "~0.2.0"
path = "module/move/sqlx_query"

[workspace.dependencies.deterministic_rand]
version = "~0.5.0"
version = "~0.6.0"
path = "module/move/deterministic_rand"

[workspace.dependencies.crates_tools]
Expand Down Expand Up @@ -536,4 +536,36 @@ version = "0.1.83"
[workspace.dependencies.tokio]
version = "1.41.0"
features = []
default-features = false
default-features = false

[workspace.dependencies.anyhow]
version = "~1.0"
# features = []
# default-features = false

[workspace.dependencies.thiserror]
version = "~1.0"
# features = []
# default-features = false

[workspace.dependencies.hashbrown]
version = "~0.14.3"
# optional = true
default-features = false
# features = [ "default" ]

[workspace.dependencies.paste]
version = "~1.0.14"
default-features = false

[workspace.dependencies.tempdir]
version = "~0.3.7"

[workspace.dependencies.rustversion]
version = "~1.0"

[workspace.dependencies.num-traits]
version = "~0.2"

[workspace.dependencies.rand]
version = "0.8.5"
1 change: 0 additions & 1 deletion cgtools
Submodule cgtools deleted from f42bdc
2 changes: 1 addition & 1 deletion module/alias/instance_of/src/typing/implements_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// #[ macro_use ]
mod implements_impl;

/// Internal namespace.
/// Define a private namespace for all its items.
mod private
{

Expand Down
2 changes: 1 addition & 1 deletion module/alias/instance_of/src/typing/is_slice_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ]

/// Internal namespace.
/// Define a private namespace for all its items.
mod private
{

Expand Down
2 changes: 1 addition & 1 deletion module/alias/wtest_basic/src/test/basic/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Helpers.
//!

/// Internal namespace.
/// Define a private namespace for all its items.
mod private
{

Expand Down
2 changes: 1 addition & 1 deletion module/alias/wtest_basic/src/test/basic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Basic tools for testing.
//!

/// Internal namespace.
/// Define a private namespace for all its items.
mod private
{
}
Expand Down
2 changes: 1 addition & 1 deletion module/core/async_from/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod dependency
pub use ::async_trait;
}

/// Internal namespace.
/// Define a private namespace for all its items.
#[ cfg( feature = "enabled" ) ]
mod private
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/async_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub mod dependency
pub use ::async_from;
}

/// Internal namespace.
/// Define a private namespace for all its items.
#[ cfg( feature = "enabled" ) ]
mod private
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/clone_dyn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub mod dependency
pub use ::clone_dyn_types;
}

/// Internal namespace.
/// Define a private namespace for all its items.
#[ cfg( feature = "enabled" ) ]
mod private
{
Expand Down
2 changes: 1 addition & 1 deletion module/core/clone_dyn_types/Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- {{# generate.module_header{} #}} -->
# Module :: clone_dyn_types
# Module :: `clone_dyn_types`
<!--{ generate.module_header.start() }-->
[![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_clone_dyn_push.yml) [![docs.rs](https://img.shields.io/docsrs/clone_dyn_types?color=e3e8f0&logo=docs.rs)](https://docs.rs/clone_dyn_types) [![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=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) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
<!--{ generate.module_header.end }-->
Expand Down
26 changes: 17 additions & 9 deletions module/core/clone_dyn_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub mod dependency
{
}

/// Internal namespace.
/// Define a private namespace for all its items.
// #[ cfg( any( not( feature = "no_std" ), feature = "use_alloc" ) ) ]
#[ cfg( feature = "enabled" ) ]
mod private
Expand Down Expand Up @@ -39,6 +39,7 @@ mod private
T : Clone,
{
#[ inline ]
#[ allow( clippy::implicit_return, clippy::as_conversions, clippy::ptr_as_ptr ) ]
fn __clone_dyn( &self, _ : DontCallMe ) -> *mut ()
{
Box::< T >::into_raw( Box::new( self.clone() ) ) as *mut ()
Expand All @@ -51,6 +52,7 @@ mod private
T : Clone,
{
#[ inline ]
#[ allow( clippy::implicit_return, clippy::as_conversions, clippy::ptr_as_ptr ) ]
fn __clone_dyn( &self, _ : DontCallMe ) -> *mut ()
{
Box::< [ T ] >::into_raw( self.iter().cloned().collect() ) as *mut ()
Expand All @@ -61,14 +63,15 @@ mod private
impl CloneDyn for str
{
#[ inline ]
#[ allow( clippy::as_conversions, clippy::ptr_as_ptr, clippy::implicit_return ) ]
fn __clone_dyn( &self, _ : DontCallMe ) -> *mut ()
{
Box::< str >::into_raw( Box::from( self ) ) as *mut ()
}
}

///
/// True clone which is applicable not only to clonable entities, but to trait objects implementing CloneDyn.
/// True clone which is applicable not only to clonable entities, but to trait objects implementing `CloneDyn`.
///
/// # Example
///
Expand Down Expand Up @@ -100,7 +103,7 @@ mod private
// that the `CloneDyn` trait is correctly implemented for the given type `T`, ensuring that `__clone_dyn` returns a
// valid pointer to a cloned instance of `T`.
//
#[ allow( unsafe_code ) ]
#[ allow( unsafe_code, clippy::as_conversions, clippy::ptr_as_ptr, clippy::implicit_return, clippy::undocumented_unsafe_blocks ) ]
unsafe
{
*Box::from_raw( < T as CloneDyn >::__clone_dyn( src, DontCallMe ) as *mut T )
Expand Down Expand Up @@ -185,7 +188,7 @@ mod private
// The safety of this function relies on the correct implementation of the `CloneDyn` trait for the given type `T`.
// Specifically, `__clone_dyn` must return a valid pointer to a cloned instance of `T`.
//
#[ allow( unsafe_code ) ]
#[ allow( unsafe_code, clippy::implicit_return, clippy::as_conversions, clippy::ptr_cast_constness, clippy::ptr_as_ptr, clippy::multiple_unsafe_ops_per_block, clippy::undocumented_unsafe_blocks, clippy::ref_as_ptr ) ]
unsafe
{
let mut ptr = ref_dyn as *const T;
Expand All @@ -207,22 +210,24 @@ mod private
impl< T : Clone > Sealed for [ T ] {}
impl Sealed for str {}
}
use sealed::*;
use sealed::{ DontCallMe, Sealed };

}

#[ cfg( feature = "enabled" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
#[ allow( clippy::pub_use ) ]
pub use own::*;

/// Own namespace of the module.
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod own
{
use super::*;
use super::orphan;
#[ doc( inline ) ]
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
pub use orphan::*;
}

Expand All @@ -231,8 +236,9 @@ pub mod own
#[ allow( unused_imports ) ]
pub mod orphan
{
use super::*;
use super::exposed;
#[ doc( inline ) ]
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
pub use exposed::*;
}

Expand All @@ -241,8 +247,9 @@ pub mod orphan
#[ allow( unused_imports ) ]
pub mod exposed
{
use super::*;
use super::prelude;
#[ doc( inline ) ]
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
pub use prelude::*;
}

Expand All @@ -251,8 +258,9 @@ pub mod exposed
#[ allow( unused_imports ) ]
pub mod prelude
{
use super::*;
use super::private;
#[ doc( inline ) ]
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
pub use private::
{
CloneDyn,
Expand Down
13 changes: 3 additions & 10 deletions module/core/collection_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,41 @@ documentation = "https://docs.rs/collection_tools"
repository = "https://github.com/Wandalen/wTools/tree/master/module/core/collection_tools"
homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/collection_tools"
description = """
Collection of general purpose tools to manipulate collections( containers like Vec/HashMap/HashSet ).
General purpose tools to manipulate collections( containers like Vec/HashMap/HashSet ).
"""
categories = [ "algorithms", "development-tools" ]
keywords = [ "fundamental", "general-purpose" ]


[lints]
workspace = true


[package.metadata.docs.rs]
features = [ "full" ]
all-features = false

[features]

no_std = [
# "test_tools/no_std",
]

use_alloc = [
"no_std", # qqq : for Anton : why is that better? -- use_alloc means that we do not use std, but alloc and hashbrown
"no_std",
"hashbrown",
# "test_tools/use_alloc", // why is it needed? -- not needed, removed
]

default = [
"enabled",
# "reexports",
"collection_constructors",
"collection_into_constructors",
]

full = [
"enabled",
# "reexports",
"collection_constructors",
"collection_into_constructors",
]

enabled = []
# reexports = []

# Collection constructors, like `hmap!{ "key" => "val" }`
collection_constructors = []
Expand All @@ -63,7 +56,7 @@ collection_into_constructors = []
[dependencies]

## external
hashbrown = { version = "~0.14.3", optional = true, default-features = false, features = [ "default" ] }
hashbrown = { workspace = true, optional = true, default-features = false, features = [ "default" ] }

[dev-dependencies]
test_tools = { workspace = true }
Expand Down
11 changes: 6 additions & 5 deletions module/core/collection_tools/Readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- {{# generate.module_header{} #}} -->

# Module :: collection_tools
# Module :: `collection_tools`
<!--{ generate.module_header.start() }-->
[![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_collection_tools_push.yml) [![docs.rs](https://img.shields.io/docsrs/collection_tools?color=e3e8f0&logo=docs.rs)](https://docs.rs/collection_tools) [![Open in Gitpod](https://raster.shields.io/static/v1?label=try&message=online&color=eee&logo=gitpod&logoColor=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) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY)
<!--{ generate.module_header.end }-->

Collection of general purpose tools to manipulate collections( containers like Vec/HashMap/HashSet... ).
General purpose tools to manipulate collections( containers like Vec/HashMap/HashSet... ).

### Basic Use Case :: Variadic Constructors for Collections

Expand Down Expand Up @@ -71,7 +71,7 @@ assert_eq!( meta_list, meta_list );

### Basic Use Case :: `no_std` `HashSet` / `HashMap`

When implementing a `no_std` environment with the `use_alloc` feature in your Rust project, you'll encounter a challenge: collections like `Vec` are imported differently depending on the availability of the `std` library. Moreover, to use data structures such as `HashSet` or `HashMap` in a `no_std` context, it's necessary to depend on third-party crates, as these are not provided by the `alloc` crate directly. This crate aims to simplify the process of designing Rust libraries or applications that require these collections in a `no_std` environment, offering a more streamlined approach to working with dynamic data structures without the standard library.
When implementing a `no_std` ( `!use_std` ) environment with the `use_alloc` feature in your Rust project, you'll encounter a challenge: collections like `Vec` are imported differently depending on the availability of the `std` library. Moreover, to use data structures such as `HashSet` or `HashMap` in a `no_std` context, it's necessary to depend on third-party crates, as these are not provided by the `alloc` crate directly. This crate aims to simplify the process of designing Rust libraries or applications that require these collections in a `no_std` environment, offering a more streamlined approach to working with dynamic data structures without the standard library.

You can do

Expand All @@ -98,7 +98,7 @@ Instead of
# #[ cfg( any( feature = "use_alloc", not( feature = "no_std" ) ) ) ]
# {

#[ cfg( feature = "use_alloc" ) ]
#[ cfg( all( feature = "no_std", feature = "use_alloc" ) ) ]
use hashbrown::HashSet; // a `no_std` replacement for `HashSet`
#[ cfg( not( feature = "no_std" ) ) ]
use std::collections::HashSet;
Expand All @@ -120,7 +120,8 @@ While strict macros require you to have all members of the same type, more relax

For example:
```rust
# #[ cfg( all( feature = "enabled", feature = "collection_into_constructors", any( not( feature = "no_std" ), feature = "use_alloc" ) ) ) ]
# #[ cfg( all( feature = "enabled", feature = "collection_into_constructors" ) ) ]
# #[ cfg( any( feature = "use_alloc", not( feature = "no_std" ) ) ) ]
# {
use std::borrow::Cow;
let vec : Vec< String > = collection_tools::into_vec!( "&str", "String".to_string(), Cow::from( "Cow" ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,15 @@
//! a `HashMap`, making your code cleaner and more concise. This is particularly useful in cases
//! where you need to define a map with a known set of key-value pairs upfront.

#[ cfg( not( all
(
// not( feature = "use_alloc" ) ) ],
all( feature = "enabled", feature = "collection_constructors" ),
any( not( feature = "no_std" ), feature = "use_alloc" )
#[ cfg( not( all(
feature = "enabled",
feature = "collection_constructors",
any( feature = "use_alloc", not( feature = "no_std" ) )
)))]
fn main(){}
fn main() {}

// zzz : aaa : rid of `#[ cfg( not( feature = "use_alloc" ) ) ]` -- Rid of by not relying on std
// #[ cfg( not( feature = "use_alloc" ) ) ]
#[ cfg( all( feature = "enabled", feature = "collection_constructors" ) ) ]
#[ cfg( any( not( feature = "no_std" ), feature = "use_alloc" ) ) ]
#[ cfg( any( feature = "use_alloc", not( feature = "no_std" ) ) ) ]
fn main()
{
use collection_tools::*;
Expand Down
Loading
Loading