@@ -42,6 +42,7 @@ pub struct Lint {
42
42
}
43
43
44
44
impl Lint {
45
+ #[ must_use]
45
46
pub fn new ( name : & str , group : & str , desc : & str , deprecation : Option < & str > , module : & str ) -> Self {
46
47
Self {
47
48
name : name. to_lowercase ( ) ,
@@ -58,19 +59,22 @@ impl Lint {
58
59
}
59
60
60
61
/// Returns the lints in a `HashMap`, grouped by the different lint groups
62
+ #[ must_use]
61
63
pub fn by_lint_group ( lints : & [ Self ] ) -> HashMap < String , Vec < Self > > {
62
64
lints
63
65
. iter ( )
64
66
. map ( |lint| ( lint. group . to_string ( ) , lint. clone ( ) ) )
65
67
. into_group_map ( )
66
68
}
67
69
70
+ #[ must_use]
68
71
pub fn is_internal ( & self ) -> bool {
69
72
self . group . starts_with ( "internal" )
70
73
}
71
74
}
72
75
73
76
/// Generates the Vec items for `register_lint_group` calls in `clippy_lints/src/lib.rs`.
77
+ #[ must_use]
74
78
pub fn gen_lint_group_list ( lints : Vec < Lint > ) -> Vec < String > {
75
79
lints
76
80
. into_iter ( )
@@ -86,6 +90,7 @@ pub fn gen_lint_group_list(lints: Vec<Lint>) -> Vec<String> {
86
90
}
87
91
88
92
/// Generates the `pub mod module_name` list in `clippy_lints/src/lib.rs`.
93
+ #[ must_use]
89
94
pub fn gen_modules_list ( lints : Vec < Lint > ) -> Vec < String > {
90
95
lints
91
96
. into_iter ( )
@@ -103,6 +108,7 @@ pub fn gen_modules_list(lints: Vec<Lint>) -> Vec<String> {
103
108
}
104
109
105
110
/// Generates the list of lint links at the bottom of the README
111
+ #[ must_use]
106
112
pub fn gen_changelog_lint_list ( lints : Vec < Lint > ) -> Vec < String > {
107
113
let mut lint_list_sorted: Vec < Lint > = lints;
108
114
lint_list_sorted. sort_by_key ( |l| l. name . clone ( ) ) ;
@@ -119,6 +125,7 @@ pub fn gen_changelog_lint_list(lints: Vec<Lint>) -> Vec<String> {
119
125
}
120
126
121
127
/// Generates the `register_removed` code in `./clippy_lints/src/lib.rs`.
128
+ #[ must_use]
122
129
pub fn gen_deprecated ( lints : & [ Lint ] ) -> Vec < String > {
123
130
lints
124
131
. iter ( )
0 commit comments