chore: fix clippy lints (#707)

This commit is contained in:
David Pedersen
2021-07-09 18:23:55 +02:00
committed by GitHub
parent 5aa8ae1fec
commit 4b0ece6d28
19 changed files with 47 additions and 41 deletions
+7 -1
View File
@@ -36,7 +36,13 @@ pub fn generate<T: Service>(
/// Generated client implementations.
#(#mod_attributes)*
pub mod #client_mod {
#![allow(unused_variables, dead_code, missing_docs)]
#![allow(
unused_variables,
dead_code,
missing_docs,
// will trigger if compression is disabled
clippy::let_unit_value,
)]
use tonic::codegen::*;
#service_doc
+1 -3
View File
@@ -284,9 +284,7 @@ fn generate_doc_comments<T: AsRef<str>>(comments: &[T]) -> TokenStream {
pub(crate) fn match_name(pattern: &str, path: &str) -> bool {
if pattern.is_empty() {
false
} else if pattern == "." {
true
} else if pattern == path {
} else if pattern == "." || pattern == path {
true
} else {
let pattern_segments = pattern.split('.').collect::<Vec<_>>();
+7 -1
View File
@@ -69,7 +69,13 @@ pub fn generate<T: Service>(
/// Generated server implementations.
#(#mod_attributes)*
pub mod #server_mod {
#![allow(unused_variables, dead_code, missing_docs)]
#![allow(
unused_variables,
dead_code,
missing_docs,
// will trigger if compression is disabled
clippy::let_unit_value,
)]
use tonic::codegen::*;
#generated_trait