Skip to content

Commit fc14f04

Browse files
committed
fixes
1 parent 95dc230 commit fc14f04

File tree

23 files changed

+117
-22
lines changed

23 files changed

+117
-22
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ exclude = [
3131
"module/alias/wtest",
3232
"module/core/meta_tools",
3333
"module/core/for_each",
34-
"module/core/reflect_tools",
35-
"module/core/format_tools",
3634
"step",
3735
]
3836
# default-members = [ "module/core/wtools" ]

module/core/collection_tools/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub mod own {
4646

4747
#[ doc( inline ) ]
4848
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
49+
#[cfg(any(feature = "use_alloc", not(feature = "no_std")))]
4950
pub use super::collection::own::*;
5051
}
5152

@@ -61,6 +62,7 @@ pub mod orphan {
6162

6263
#[ doc( inline ) ]
6364
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
65+
#[cfg(any(feature = "use_alloc", not(feature = "no_std")))]
6466
pub use collection::orphan::*;
6567
}
6668

@@ -73,10 +75,12 @@ pub mod exposed {
7375

7476
#[ doc( inline ) ]
7577
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
78+
#[cfg(any(feature = "use_alloc", not(feature = "no_std")))]
7679
pub use prelude::*;
7780

7881
#[ doc( inline ) ]
7982
#[ allow( clippy::useless_attribute, clippy::pub_use ) ]
83+
#[cfg(any(feature = "use_alloc", not(feature = "no_std")))]
8084
pub use collection::exposed::*;
8185
}
8286

@@ -92,6 +96,13 @@ pub mod prelude {
9296
pub use collection::prelude::*;
9397
}
9498

99+
/// Empty prelude for no_std configurations
100+
#[ cfg( feature = "enabled" ) ]
101+
#[cfg(all(feature = "no_std", not(feature = "use_alloc")))]
102+
#[ allow( unused_imports ) ]
103+
pub mod prelude {
104+
}
105+
95106
// pub use own::collection as xxx;
96107
// pub use hmap as xxx;
97108
// pub use own::HashMap as xxx;

module/core/collection_tools/tests/inc/llist.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ fn into_constructor() {
4949
#[ test ]
5050
fn iters() {
5151
struct MyContainer {
52+
#[allow(clippy::linkedlist)]
5253
entries: the_module::LinkedList<i32>,
5354
}
5455

module/core/collection_tools/tests/inc/vec.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@ use super::*;
33
#[ test ]
44
#[cfg(any(feature = "use_alloc", not(feature = "no_std")))]
55
fn reexport() {
6-
let mut vec1: the_module::Vec< i32 > = the_module::Vec::new();
7-
vec1.push(1);
8-
vec1.push(2);
6+
let vec1: the_module::Vec< i32 > = the_module::vec![ 1, 2 ];
97
let got = *vec1.first().unwrap();
108
assert_eq!(got, 1);
119
let got = *vec1.last().unwrap();
1210
assert_eq!(got, 2);
1311

1412
use std::vec::Vec as DynList;
15-
let mut vec2: DynList<i32> = DynList::new();
16-
vec2.push(1);
17-
vec2.push(2);
13+
let vec2: DynList<i32> = DynList::from([ 1, 2 ]);
1814
let got = *vec2.first().unwrap();
1915
assert_eq!(got, 1);
2016
let got = *vec2.last().unwrap();
@@ -33,9 +29,7 @@ fn constructor() {
3329

3430
// test.case( "multiple entry" );
3531
let got = the_module::vec! { 3, 13 };
36-
let mut exp = the_module::Vec::new();
37-
exp.push(3);
38-
exp.push(13);
32+
let exp = the_module::vec![ 3, 13 ];
3933
assert_eq!(got, exp);
4034

4135
let _got = the_module::vec!("b");
@@ -53,9 +47,7 @@ fn into_constructor() {
5347

5448
// test.case( "multiple entry" );
5549
let got: the_module::Vec< i32 > = the_module::into_vec! { 3, 13 };
56-
let mut exp = the_module::Vec::new();
57-
exp.push(3);
58-
exp.push(13);
50+
let exp = the_module::vec![ 3, 13 ];
5951
assert_eq!(got, exp);
6052

6153
let _got: Vec< &str > = the_module::into_vec!("b");

module/core/format_tools/src/format/to_string/aref.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use core::ops::{ Deref };
77

88
/// Reference wrapper to make into string conversion with fallback.
99
#[ allow( missing_debug_implementations ) ]
10+
#[ allow( dead_code ) ]
1011
#[ repr( transparent ) ]
1112
pub struct Ref< 'a, T, How >
1213
( pub Ref2< 'a, T, How > )

module/core/format_tools/src/lib.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,56 @@
33
#![ doc( html_root_url = "https://docs.rs/reflect_tools/latest/reflect_tools/" ) ]
44
#![ cfg_attr( doc, doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "readme.md" ) ) ) ]
55
#![ cfg_attr( not( doc ), doc = "Formatting utilities" ) ]
6+
#![ allow( clippy::similar_names ) ]
7+
#![ allow( clippy::double_parens ) ]
8+
#![ allow( clippy::empty_line_after_doc_comments ) ]
9+
#![ allow( clippy::redundant_else ) ]
10+
#![ allow( clippy::single_match_else ) ]
11+
#![ allow( clippy::needless_late_init ) ]
12+
#![ allow( clippy::match_same_arms ) ]
13+
#![ allow( clippy::implicit_clone ) ]
14+
#![ allow( clippy::unnecessary_wraps ) ]
15+
#![ allow( clippy::explicit_iter_loop ) ]
16+
#![ allow( clippy::elidable_lifetime_names ) ]
17+
#![ allow( clippy::needless_borrow ) ]
18+
#![ allow( clippy::std_instead_of_core ) ]
19+
#![ allow( clippy::doc_lazy_continuation ) ]
20+
#![ allow( clippy::cast_possible_truncation ) ]
21+
#![ allow( clippy::cast_sign_loss ) ]
22+
#![ allow( clippy::must_use_candidate ) ]
23+
#![ allow( clippy::unreadable_literal ) ]
24+
#![ allow( clippy::type_complexity ) ]
25+
#![ allow( clippy::default_trait_access ) ]
26+
#![ allow( clippy::missing_errors_doc ) ]
27+
#![ allow( clippy::manual_string_new ) ]
28+
#![ allow( clippy::explicit_counter_loop ) ]
29+
#![ allow( clippy::uninlined_format_args ) ]
30+
#![ allow( clippy::manual_map ) ]
31+
#![ allow( clippy::doc_markdown ) ]
32+
#![ allow( clippy::extra_unused_lifetimes ) ]
33+
#![ allow( clippy::unnecessary_cast ) ]
34+
#![ allow( clippy::redundant_closure ) ]
35+
#![ allow( clippy::needless_borrows_for_generic_args ) ]
36+
#![ allow( clippy::derivable_impls ) ]
37+
#![ allow( clippy::write_with_newline ) ]
38+
#![ allow( clippy::bool_to_int_with_if ) ]
39+
#![ allow( clippy::redundant_static_lifetimes ) ]
40+
#![ allow( clippy::inconsistent_struct_constructor ) ]
41+
#![ allow( clippy::len_zero ) ]
42+
#![ allow( clippy::needless_as_bytes ) ]
43+
#![ allow( clippy::struct_field_names ) ]
44+
#![ allow( clippy::unnecessary_semicolon ) ]
45+
#![ allow( clippy::match_bool ) ]
46+
#![ allow( clippy::implicit_hasher ) ]
47+
#![ allow( clippy::map_identity ) ]
48+
#![ allow( clippy::manual_repeat_n ) ]
49+
#![ allow( clippy::too_many_lines ) ]
50+
#![ allow( clippy::needless_pass_by_value ) ]
51+
#![ allow( clippy::collapsible_else_if ) ]
52+
#![ allow( clippy::needless_return ) ]
53+
#![ allow( clippy::needless_raw_string_hashes ) ]
54+
#![ allow( clippy::ref_option ) ]
55+
#![ allow( clippy::owned_cow ) ]
656

757
#[ cfg( feature = "enabled" ) ]
858
pub mod format;

module/core/format_tools/tests/tests.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22
33
// #![ feature( trace_macros ) ]
44
#![ allow( unused_imports ) ]
5+
#![ allow( clippy::unreadable_literal ) ]
6+
#![ allow( clippy::needless_raw_string_hashes ) ]
7+
#![ allow( clippy::default_trait_access ) ]
8+
#![ allow( clippy::uninlined_format_args ) ]
9+
#![ allow( clippy::ref_option ) ]
10+
#![ allow( clippy::useless_conversion ) ]
11+
#![ allow( clippy::owned_cow ) ]
12+
#![ allow( clippy::type_complexity ) ]
13+
#![ allow( clippy::elidable_lifetime_names ) ]
14+
#![ allow( clippy::redundant_closure ) ]
15+
#![ allow( clippy::println_empty_string ) ]
16+
#![ allow( clippy::field_reassign_with_default ) ]
17+
#![ allow( clippy::never_loop ) ]
518

619
use format_tools as the_module;
720
use test_tools::exposed::*;

module/core/pth/src/path.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ mod private
208208
#[ cfg( feature = "no_std" ) ]
209209
extern crate alloc;
210210
#[ cfg( feature = "no_std" ) ]
211+
#[ allow( unused_imports ) ]
211212
use alloc::string::ToString;
212213

213214
// println!( "a" );
@@ -330,11 +331,13 @@ mod private
330331
/// # Panics
331332
/// qqq: doc
332333
// qqq : make macro paths_join!( ... )
333-
pub fn iter_join< 'a ,I, P >( paths : I ) -> PathBuf
334+
pub fn iter_join< 'a ,I, P >( paths : I ) -> std::path::PathBuf
334335
where
335336
I : Iterator< Item = P >,
336337
P : TryIntoCowPath< 'a >,
337338
{
339+
#[ allow( unused_imports ) ]
340+
use std::path::PathBuf;
338341
#[ cfg( feature = "no_std" ) ]
339342
extern crate alloc;
340343
#[ cfg( feature = "no_std" ) ]

module/core/pth/src/path/absolute_path.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ mod private
55
use std::
66
{
77
path::{ Path, PathBuf },
8+
borrow::Cow,
89
io,
910
};
1011
use core::

module/core/pth/src/path/canonical_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod private
55

66
use std::
77
{
8-
// borrow::Cow,
8+
borrow::Cow,
99
path::{ Path, PathBuf },
1010
io,
1111
};

0 commit comments

Comments
 (0)