chore: clippy lints (#467)

* chore: clippy lints
This commit is contained in:
Juan Alvarez
2020-09-29 14:38:49 -05:00
committed by GitHub
parent 9ea4a64a6c
commit 0c69c378fd
27 changed files with 69 additions and 88 deletions
-3
View File
@@ -251,7 +251,6 @@ pub async fn status_code_and_message(client: &mut TestClient, assertions: &mut V
response_status: Some(EchoStatus {
code: 2,
message: TEST_STATUS_MESSAGE.to_string(),
..Default::default()
}),
..Default::default()
};
@@ -260,7 +259,6 @@ pub async fn status_code_and_message(client: &mut TestClient, assertions: &mut V
response_status: Some(EchoStatus {
code: 2,
message: TEST_STATUS_MESSAGE.to_string(),
..Default::default()
}),
..Default::default()
};
@@ -286,7 +284,6 @@ pub async fn special_status_message(client: &mut TestClient, assertions: &mut Ve
response_status: Some(EchoStatus {
code: 2,
message: SPECIAL_TEST_STATUS_MESSAGE.to_string(),
..Default::default()
}),
..Default::default()
};
+1 -1
View File
@@ -50,7 +50,7 @@ fn response_length(response: &pb::StreamingOutputCallResponse) -> i32 {
}
}
fn response_lengths(responses: &Vec<pb::StreamingOutputCallResponse>) -> Vec<i32> {
fn response_lengths(responses: &[pb::StreamingOutputCallResponse]) -> Vec<i32> {
responses.iter().map(&response_length).collect()
}
+2 -3
View File
@@ -21,6 +21,7 @@ type Streaming<T> = Request<tonic::Streaming<T>>;
type Stream<T> = Pin<
Box<dyn futures_core::Stream<Item = std::result::Result<T, Status>> + Send + Sync + 'static>,
>;
type BoxFuture<T, E> = Pin<Box<dyn Future<Output = std::result::Result<T, E>> + Send + 'static>>;
#[tonic::async_trait]
impl pb::test_service_server::TestService for TestService {
@@ -187,9 +188,7 @@ where
{
type Response = S::Response;
type Error = S::Error;
type Future = Pin<
Box<dyn Future<Output = std::result::Result<Self::Response, Self::Error>> + Send + 'static>,
>;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<std::result::Result<(), Self::Error>> {
Ok(()).into()