Skip to content

Commit 9f395e2

Browse files
committed
mod_interface : cleaning
1 parent 05868dd commit 9f395e2

File tree

69 files changed

+437
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+437
-258
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,5 +551,9 @@ version = "~1.0"
551551
[workspace.dependencies.hashbrown]
552552
version = "~0.14.3"
553553
# optional = true
554-
# default-features = false
554+
default-features = false
555555
# features = [ "default" ]
556+
557+
[workspace.dependencies.paste]
558+
version = "~1.0.14"
559+
default-features = false

module/core/meta_tools/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ default = [
3232
"meta_for_each",
3333
"meta_impls_index",
3434
# "meta_mod_interface",
35-
"meta_constructors",
35+
# "meta_constructors",
3636
"meta_idents_concat",
3737
]
3838
full = [
3939
"enabled",
4040
"meta_for_each",
4141
"meta_impls_index",
4242
# "meta_mod_interface",
43-
"meta_constructors",
43+
# "meta_constructors",
4444
"meta_idents_concat",
4545
]
4646
no_std = []
@@ -52,14 +52,14 @@ meta_impls_index = [ "impls_index/enabled" ]
5252
meta_mod_interface = [ "mod_interface/enabled" ]
5353
# xxx : qqq : make mod_interface optional maybe
5454

55-
meta_constructors = [ "literally" ]
55+
# meta_constructors = [ "literally" ]
5656
meta_idents_concat = [ "paste" ]
5757

5858
[dependencies]
5959

60-
## external
61-
literally = { version = "~0.1.3", optional = true, default-features = false }
62-
paste = { version = "~1.0.14", optional = true, default-features = false }
60+
# ## external
61+
# literally = { version = "~0.1.3", optional = true, default-features = false }
62+
paste = { workspace = true, optional = true, default-features = false }
6363

6464
## internal
6565
impls_index = { workspace = true }

module/core/meta_tools/Readme.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@
77

88
Collection of general purpose meta tools.
99

10-
### Basic use-case :: variadic constructor of collections
11-
12-
Among other useful meta tools the module aggregates variadic constructors of collections. For example macro `hmap!` for constructing a hash map.
13-
14-
<!-- {{# generate.module{} #}} -->
15-
16-
```rust
17-
use meta_tools::*;
18-
19-
let meta_map = hmap! { 3 => 13 };
20-
let mut std_map = std::collections::HashMap::new();
21-
std_map.insert( 3, 13 );
22-
assert_eq!( meta_map, std_map );
23-
```
24-
2510
### Basic Use Case :: function-style call
2611

2712
Apply a macro for each element of a list.

module/core/meta_tools/examples/meta_tools_trivial.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ use meta_tools::*;
33

44
fn main()
55
{
6-
let meta_map = hmap! { 3 => 13 };
7-
let mut std_map = std::collections::HashMap::new();
8-
std_map.insert( 3, 13 );
9-
assert_eq!( meta_map, std_map );
6+
for_each!( dbg, "a", "b", "c" );
7+
8+
// generates
9+
dbg!( "a" );
10+
dbg!( "b" );
11+
dbg!( "c" );
1012
}

module/core/meta_tools/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pub mod dependency
1717
#[ cfg( feature = "meta_impls_index" ) ]
1818
pub use ::impls_index;
1919

20-
#[ cfg( feature = "meta_constructors" ) ]
21-
pub use ::literally;
20+
// #[ cfg( feature = "meta_constructors" ) ]
21+
// pub use ::literally;
2222
#[ cfg( feature = "meta_idents_concat" ) ]
2323
pub use ::paste;
2424

module/core/meta_tools/src/meta.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ mod_interface::mod_interface!
2222
// #[ cfg( feature = "meta_mod_interface" ) ]
2323
prelude use ::mod_interface::mod_interface;
2424

25-
#[ cfg( feature = "meta_constructors" ) ]
26-
prelude use ::literally::*;
25+
// #[ cfg( feature = "meta_constructors" ) ]
26+
// prelude use ::literally::*;
2727
#[ cfg( feature = "meta_idents_concat" ) ]
2828
prelude use ::paste::paste as meta_idents_concat;
2929

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
use super::*;
2-
3-
//
4-
5-
tests_impls!
6-
{
7-
8-
fn hash_map()
9-
{
10-
11-
// test.case( "empty" );
12-
let got : std::collections::HashMap< i32, i32 > = the_module::hmap!{};
13-
let exp = std::collections::HashMap::new();
14-
a_id!( got, exp );
15-
16-
// test.case( "single entry" );
17-
let got = the_module::hmap!{ 3 => 13 };
18-
let mut exp = std::collections::HashMap::new();
19-
exp.insert( 3, 13 );
20-
a_id!( got, exp );
21-
22-
}
23-
24-
//
25-
26-
27-
fn hash_set()
28-
{
29-
30-
// test.case( "empty" );
31-
let got : std::collections::HashSet< i32 > = the_module::hset!{};
32-
let exp = std::collections::HashSet::new();
33-
a_id!( got, exp );
34-
35-
// test.case( "single entry" );
36-
let got = the_module::hset!{ 13 };
37-
let mut exp = std::collections::HashSet::new();
38-
exp.insert( 13 );
39-
a_id!( got, exp );
40-
41-
}
42-
}
43-
44-
//
45-
46-
tests_index!
47-
{
48-
hash_map,
49-
hash_set,
50-
}
1+
// use super::*;
2+
//
3+
// //
4+
//
5+
// tests_impls!
6+
// {
7+
//
8+
// fn hash_map()
9+
// {
10+
//
11+
// // test.case( "empty" );
12+
// let got : std::collections::HashMap< i32, i32 > = the_module::hmap!{};
13+
// let exp = std::collections::HashMap::new();
14+
// a_id!( got, exp );
15+
//
16+
// // test.case( "single entry" );
17+
// let got = the_module::hmap!{ 3 => 13 };
18+
// let mut exp = std::collections::HashMap::new();
19+
// exp.insert( 3, 13 );
20+
// a_id!( got, exp );
21+
//
22+
// }
23+
//
24+
// //
25+
//
26+
//
27+
// fn hash_set()
28+
// {
29+
//
30+
// // test.case( "empty" );
31+
// let got : std::collections::HashSet< i32 > = the_module::hset!{};
32+
// let exp = std::collections::HashSet::new();
33+
// a_id!( got, exp );
34+
//
35+
// // test.case( "single entry" );
36+
// let got = the_module::hset!{ 13 };
37+
// let mut exp = std::collections::HashSet::new();
38+
// exp.insert( 13 );
39+
// a_id!( got, exp );
40+
//
41+
// }
42+
// }
43+
//
44+
// //
45+
//
46+
// tests_index!
47+
// {
48+
// hash_map,
49+
// hash_set,
50+
// }

module/core/meta_tools/tests/inc/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#[ allow( unused_imports ) ]
22
use super::*;
33

4-
#[ cfg( any( feature = "meta_constructors", feature = "meta_constructors" ) ) ]
5-
mod meta_constructor_test;
4+
// #[ cfg( any( feature = "meta_constructors", feature = "meta_constructors" ) ) ]
5+
// mod meta_constructor_test;
66

77
#[ cfg( any( feature = "meta_idents_concat", feature = "meta_idents_concat" ) ) ]
88
mod indents_concat_test;
99

10-
#[ cfg( any( feature = "for_each", feature = "meta_for_each" ) ) ]
10+
#[ cfg( any( feature = "meta_for_each" ) ) ]
1111
#[ path = "../../../for_each/tests/inc/mod.rs" ]
1212
mod for_each_test;
1313

14-
#[ cfg( any( feature = "impls_index", feature = "meta_impls_index" ) ) ]
14+
#[ cfg( any( feature = "meta_impls_index" ) ) ]
1515
#[ path = "../../../impls_index/tests/inc/mod.rs" ]
1616
mod impls_index;
1717

module/core/mod_interface/Readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This example demonstrates how to use the `mod_interface` crate to organize a Rus
2525
use mod_interface::mod_interface;
2626

2727
// Define a module named `child`.
28-
mod child
28+
pub mod child
2929
{
3030

3131
// Define a private namespace for all its items.
@@ -162,6 +162,7 @@ pub mod own
162162
use super::*;
163163
pub use orphan::*;
164164
pub use super::child::orphan::*;
165+
pub use super::child;
165166
}
166167

167168
/// Orphan namespace of the module.

module/core/mod_interface/examples/mod_interface_trivial/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use mod_interface::mod_interface;
44

55
/// Children.
6-
mod child;
6+
pub mod child;
77

88
// Priave namespaces is necessary.
99
mod private {}

0 commit comments

Comments
 (0)