File tree Expand file tree Collapse file tree 3 files changed +30
-22
lines changed Expand file tree Collapse file tree 3 files changed +30
-22
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,31 @@ smallvec = { version = "1.13.1", features = ["union"] }
19
19
[features ]
20
20
default = [" std" ]
21
21
std = []
22
+
23
+ [lints .rust ]
24
+ future_incompatible = " warn"
25
+ let_underscore = " warn"
26
+ missing_debug_implementations = " warn"
27
+ rust_2018_idioms = " warn"
28
+ rust_2021_compatibility = " warn"
29
+ unreachable_pub = " warn"
30
+ unsafe_code = " warn"
31
+ unused = " warn"
32
+
33
+ [lints .clippy ]
34
+ pedantic = " warn"
35
+ clone_on_ref_ptr = " warn"
36
+ missing_const_for_fn = " warn"
37
+ self_named_module_files = " warn"
38
+
39
+ # Repetitions of module/type names occur frequently when using many
40
+ # modules for keeping the size of the source files handy. Often
41
+ # types have the same name as their parent module.
42
+ module_name_repetitions = " allow"
43
+
44
+ # Repeating the type name in `Default::default()` expressions
45
+ # is not needed as long as the context is obvious.
46
+ default_trait_access = " allow"
47
+
48
+ # The error types returned should be self-explanatory.
49
+ missing_errors_doc = " allow"
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ impl PhoneNumber {
46
46
}
47
47
48
48
impl PhoneNumber {
49
- pub fn len ( & self ) -> usize {
49
+ fn len ( & self ) -> usize {
50
50
self . 0 . chars ( ) . filter ( |c| !c. is_whitespace ( ) ) . count ( )
51
51
}
52
52
}
@@ -137,7 +137,7 @@ impl Quantity {
137
137
Self ( 1 )
138
138
}
139
139
140
- fn new ( value : usize ) -> Self {
140
+ const fn new ( value : usize ) -> Self {
141
141
Self ( value)
142
142
}
143
143
}
Original file line number Diff line number Diff line change 1
1
// SPDX-FileCopyrightText: slowtec GmbH
2
2
// SPDX-License-Identifier: MPL-2.0
3
3
4
- // Opt-in for allowed-by-default lints (in alphabetical order)
5
- // See also: <https://doc.rust-lang.org/rustc/lints>
6
- #![ warn( future_incompatible) ]
7
- #![ warn( let_underscore) ]
8
- #![ warn( missing_debug_implementations) ]
9
- #![ warn( rust_2018_idioms) ]
10
- #![ warn( rust_2021_compatibility) ]
11
- #![ warn( unreachable_pub) ]
12
- #![ warn( unsafe_code) ]
13
- #![ warn( unused) ]
14
- // Clippy lints
15
- #![ warn( clippy:: pedantic) ]
16
- // Additional restrictions
17
- #![ warn( clippy:: clone_on_ref_ptr) ]
18
- #![ warn( clippy:: missing_const_for_fn) ]
19
- #![ warn( clippy:: mod_module_files) ]
20
- // Repeating the type name in `..Default::default()` expressions
21
- // is not needed since the context is obvious.
22
- #![ allow( clippy:: default_trait_access) ]
23
- // Opt-out of feature "std"
24
4
#![ cfg_attr( not( feature = "std" ) , no_std) ]
25
5
26
6
//! # semval
You can’t perform that action at this time.
0 commit comments