1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! DIPPER Core modules
// -------- rust coding guidelines: https://rust-coding-guidelines.github.io/rust-coding-guidelines-zh/ --------
// -------- rustc lint doc: https://doc.rust-lang.org/rustc/lints/listing/index.html --------
// -------- rust-clippy doc: https://rust-lang.github.io/rust-clippy/master/index.html --------
// [REQUIRED] G.VAR.02 Do not use non-ASCII characters in identifiers
// [REQUIRED]
// [REQUIRED]
// [RECOMMENDED] G.CNS.05 Use const fn for functions or methods wherever applicable
// [REQUIRED] G.TYP.01 Prefer safe conversion functions over `as` for type casting
// [RECOMMENDED] G.VAR.01 Avoid using too many meaningless variable names when destructuring tuples with more than four
// variables
// [RECOMMENDED] G.TYP.02 Explicitly specify the type for numeric literals
// [RECOMMENDED] G.TYP.03 Use `try_from` methods instead of relying on numeric boundaries for safe conversion
// [RECOMMENDED] G.TYP.BOL.02 Use `if` expressions instead of `match` for boolean conditions
// [RECOMMENDED] G.TYP.BOL.05 Use logical operators (&&/||) instead of bitwise operators (&/|) for boolean operations
// when not necessary
// [REQUIRED] G.TYP.INT.02 Avoid `as` casting between signed and unsigned integers; use safe conversion functions
// [REQUIRED] G.TYP.INT.03 Avoid using `%` for modulo operations on negative numbers
// [REQUIRED] G.TYP.FLT.02 Avoid precision loss when casting from any numeric type to floating-point; use safe
// conversion functions
// [REQUIRED] G.TYP.FLT.03 Be cautious of precision loss in floating-point arithmetic and comparisons
// [REQUIRED] G.TYP.FLT.04 Use Rust's built-in methods for floating-point calculations
// [OPTIONAL] G.TYP.SCT.02 Consider refactoring when a struct contains more than three boolean fields
// #![warn(clippy::struct_excessive_bools)]
// [RECOMMENDED] G.FUD.03 Consider using a custom struct or enum instead of many boolean parameters in function
// signatures
// [RECOMMENDED] G.TYP.ENM.04 Avoid using glob imports for enum variants in `use` statements
// [OPTIONAL] G.STR.02 Use `push_str` method for appending strings
// #![warn(clippy::string_add_assign, clippy::string_add)]
// [RECOMMENDED] G.STR.03 Convert string literals containing only ASCII characters to byte sequences using `b"str"`
// syntax instead of `as_bytes()`
// [RECOMMENDED] G.STR.05 Take care to avoid disrupting UTF-8 encoding when slicing strings at specific positions
// [RECOMMENDED] G.FUD.02 Prefer passing large values by reference if function parameters implement `Copy`
// [RECOMMENDED] G.FUD.04 Pass small `Copy` type values by value instead of by reference
// [OPTIONAL] G.FUD.05 Avoid using `inline(always)` for functions indiscriminately
// #![warn(clippy::inline_always)]
// [REQUIRED] G.GEN.02 Be cautious to avoid using generic default implementations of some methods from Rust's standard
// library; prefer specific type implementations
// [OPTIONAL] G.TRA.BLN.01 Prefer using the concrete type's `default()` method over calling `Default::default()`
// #![warn(clippy::default_trait_access)]
// [REQUIRED] G.TRA.BLN.02 Do not implement the `Copy` trait for iterators
// [RECOMMENDED] G.TRA.BLN.07 Use `copied` method instead of `cloned` for iterable `Copy` types
// [REQUIRED] G.MOD.04 Avoid using different module layout styles within the same project
// [RECOMMENDED] G.CAR.02 Ensure that necessary metadata is included in the `Cargo.toml` of the crate
// [RECOMMENDED] G.CAR.03 Avoid negative or redundant prefixes and suffixes in feature names
// [REQUIRED] G.CAR.04 Avoid using wildcard dependencies in `Cargo.toml`
// [RECOMMENDED] G.MAC.01 Only use the `dbg!()` macro for debugging code
// [REQUIRED] Ensure that locks are released before `await` is called in asynchronous code
// [REQUIRED] Handle `RefCell` references across `await` points
// [RECOMMENDED] G.ASY.04 Avoid defining unnecessary async functions
// [REQUIRED] G.UNS.SAS.02 Use `assert!` instead of `debug_assert!` to verify boundary conditions in unsafe functions
// #![deny(missing_docs)]
pub use *;
pub use *;