Fix clippy warnings

This commit is contained in:
Artem Vorotnikov
2019-12-06 03:50:19 +03:00
committed by Tim
parent 7f871f03ef
commit 7cc8d9640b
5 changed files with 9 additions and 7 deletions

View File

@@ -41,13 +41,13 @@ fn syntax() {
async fn attr(s: String) -> String;
async fn no_args_no_return();
async fn no_args() -> ();
async fn one_arg(foo: String) -> i32;
async fn two_args_no_return(bar: String, baz: u64);
async fn two_args(bar: String, baz: u64) -> String;
async fn one_arg(one: String) -> i32;
async fn two_args_no_return(one: String, two: u64);
async fn two_args(one: String, two: u64) -> String;
async fn no_args_ret_error() -> i32;
async fn one_arg_ret_error(foo: String) -> String;
async fn one_arg_ret_error(one: String) -> String;
async fn no_arg_implicit_return_error();
#[doc = "attr"]
async fn one_arg_implicit_return_error(foo: String);
async fn one_arg_implicit_return_error(one: String);
}
}

View File

@@ -132,7 +132,7 @@ impl publisher::Publisher for Publisher {
fn unsubscribe(self, _: context::Context, id: u32) -> Self::UnsubscribeFut {
eprintln!("Unsubscribing {}", id);
let mut clients = self.clients.lock().unwrap();
if let None = clients.remove(&id) {
if clients.remove(&id).is_none() {
eprintln!(
"Client {} not found. Existings clients: {:?}",
id, &*clients

View File

@@ -204,6 +204,7 @@
//! Use `cargo doc` as you normally would to see the documentation created for all
//! items expanded by a `service!` invocation.
#![deny(missing_docs)]
#![allow(clippy::type_complexity)]
pub mod rpc;
pub use rpc::*;

View File

@@ -42,7 +42,7 @@ pub struct Context {
#[cfg(feature = "serde1")]
fn ten_seconds_from_now() -> SystemTime {
return SystemTime::now() + Duration::from_secs(10);
SystemTime::now() + Duration::from_secs(10)
}
/// Returns the context for the current request, or a default Context if no request is active.

View File

@@ -533,6 +533,7 @@ struct Resp<F, R> {
}
#[derive(Debug)]
#[allow(clippy::enum_variant_names)]
enum RespState {
PollResp,
PollReady,