chore: clippy fixes (#2110)

This commit is contained in:
Artem Vorotnikov 2020-01-15 02:12:08 +03:00 committed by Carl Lerche
parent eb1a8e1792
commit bd8971cd95
5 changed files with 11 additions and 7 deletions

View File

@ -280,7 +280,7 @@ cfg_if! {
use winapi::um::timezoneapi::*; use winapi::um::timezoneapi::*;
use winapi::um::wincrypt::*; use winapi::um::wincrypt::*;
const FRIENDLY_NAME: &'static str = "tokio-tls localhost testing cert"; const FRIENDLY_NAME: &str = "tokio-tls localhost testing cert";
fn contexts() -> (tokio_tls::TlsAcceptor, tokio_tls::TlsConnector) { fn contexts() -> (tokio_tls::TlsAcceptor, tokio_tls::TlsConnector) {
let cert = localhost_cert(); let cert = localhost_cert();
@ -433,7 +433,7 @@ description should mention "tokio-tls".
let mut expiration_date: SYSTEMTIME = mem::zeroed(); let mut expiration_date: SYSTEMTIME = mem::zeroed();
GetSystemTime(&mut expiration_date); GetSystemTime(&mut expiration_date);
let mut file_time: FILETIME = mem::zeroed(); let mut file_time: FILETIME = mem::zeroed();
let res = SystemTimeToFileTime(&mut expiration_date, let res = SystemTimeToFileTime(&expiration_date,
&mut file_time); &mut file_time);
if res != TRUE { if res != TRUE {
return Err(Error::last_os_error()); return Err(Error::last_os_error());

View File

@ -1,5 +1,9 @@
#![doc(html_root_url = "https://docs.rs/tokio/0.2.9")] #![doc(html_root_url = "https://docs.rs/tokio/0.2.9")]
#![allow(clippy::cognitive_complexity, clippy::needless_doctest_main)] #![allow(
clippy::cognitive_complexity,
clippy::large_enum_variant,
clippy::needless_doctest_main
)]
#![warn( #![warn(
missing_debug_implementations, missing_debug_implementations,
missing_docs, missing_docs,

View File

@ -107,11 +107,11 @@ impl Future for Child {
Poll::Pending => return Poll::Pending, Poll::Pending => return Poll::Pending,
} }
let status = try_wait(&inner.child)?.expect("not ready yet"); let status = try_wait(&inner.child)?.expect("not ready yet");
return Poll::Ready(Ok(status.into())); return Poll::Ready(Ok(status));
} }
if let Some(e) = try_wait(&inner.child)? { if let Some(e) = try_wait(&inner.child)? {
return Poll::Ready(Ok(e.into())); return Poll::Ready(Ok(e));
} }
let (tx, rx) = oneshot::channel(); let (tx, rx) = oneshot::channel();
let ptr = Box::into_raw(Box::new(Some(tx))); let ptr = Box::into_raw(Box::new(Some(tx)));

View File

@ -13,7 +13,7 @@ impl Stream for Alternate {
fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<i32>> { fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<i32>> {
let val = self.state; let val = self.state;
self.state = self.state + 1; self.state += 1;
// if it's even, Some(i32), else None // if it's even, Some(i32), else None
if val % 2 == 0 { if val % 2 == 0 {

View File

@ -103,7 +103,7 @@ fn write_read_shared_pending() {
assert_ready!(t2.poll()); assert_ready!(t2.poll());
let mut t3 = spawn(rwlock.write()); let mut t3 = spawn(rwlock.write());
let mut _g2 = assert_pending!(t3.poll()); assert_pending!(t3.poll());
let mut t4 = spawn(rwlock.read()); let mut t4 = spawn(rwlock.read());
assert_pending!(t4.poll()); assert_pending!(t4.poll());