@@ -42,6 +42,7 @@ pub struct Lint {
4242}
4343
4444impl Lint {
45+ #[ must_use]
4546 pub fn new ( name : & str , group : & str , desc : & str , deprecation : Option < & str > , module : & str ) -> Self {
4647 Self {
4748 name : name. to_lowercase ( ) ,
@@ -58,19 +59,22 @@ impl Lint {
5859 }
5960
6061 /// Returns the lints in a `HashMap`, grouped by the different lint groups
62+ #[ must_use]
6163 pub fn by_lint_group ( lints : & [ Self ] ) -> HashMap < String , Vec < Self > > {
6264 lints
6365 . iter ( )
6466 . map ( |lint| ( lint. group . to_string ( ) , lint. clone ( ) ) )
6567 . into_group_map ( )
6668 }
6769
70+ #[ must_use]
6871 pub fn is_internal ( & self ) -> bool {
6972 self . group . starts_with ( "internal" )
7073 }
7174}
7275
7376/// Generates the Vec items for `register_lint_group` calls in `clippy_lints/src/lib.rs`.
77+ #[ must_use]
7478pub fn gen_lint_group_list ( lints : Vec < Lint > ) -> Vec < String > {
7579 lints
7680 . into_iter ( )
@@ -86,6 +90,7 @@ pub fn gen_lint_group_list(lints: Vec<Lint>) -> Vec<String> {
8690}
8791
8892/// Generates the `pub mod module_name` list in `clippy_lints/src/lib.rs`.
93+ #[ must_use]
8994pub fn gen_modules_list ( lints : Vec < Lint > ) -> Vec < String > {
9095 lints
9196 . into_iter ( )
@@ -103,6 +108,7 @@ pub fn gen_modules_list(lints: Vec<Lint>) -> Vec<String> {
103108}
104109
105110/// Generates the list of lint links at the bottom of the README
111+ #[ must_use]
106112pub fn gen_changelog_lint_list ( lints : Vec < Lint > ) -> Vec < String > {
107113 let mut lint_list_sorted: Vec < Lint > = lints;
108114 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> {
119125}
120126
121127/// Generates the `register_removed` code in `./clippy_lints/src/lib.rs`.
128+ #[ must_use]
122129pub fn gen_deprecated ( lints : & [ Lint ] ) -> Vec < String > {
123130 lints
124131 . iter ( )
0 commit comments