Skip to content

Commit

Permalink
chore: clippy fixes (#2110)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorot93 authored and carllerche committed Jan 14, 2020
1 parent eb1a8e1 commit bd8971c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tokio-tls/tests/smoke.rs
Expand Up @@ -280,7 +280,7 @@ cfg_if! {
use winapi::um::timezoneapi::*;
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) {
let cert = localhost_cert();
Expand Down Expand Up @@ -433,7 +433,7 @@ description should mention "tokio-tls".
let mut expiration_date: SYSTEMTIME = mem::zeroed();
GetSystemTime(&mut expiration_date);
let mut file_time: FILETIME = mem::zeroed();
let res = SystemTimeToFileTime(&mut expiration_date,
let res = SystemTimeToFileTime(&expiration_date,
&mut file_time);
if res != TRUE {
return Err(Error::last_os_error());
Expand Down
6 changes: 5 additions & 1 deletion tokio/src/lib.rs
@@ -1,5 +1,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(
missing_debug_implementations,
missing_docs,
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/process/windows.rs
Expand Up @@ -107,11 +107,11 @@ impl Future for Child {
Poll::Pending => return Poll::Pending,
}
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)? {
return Poll::Ready(Ok(e.into()));
return Poll::Ready(Ok(e));
}
let (tx, rx) = oneshot::channel();
let ptr = Box::into_raw(Box::new(Some(tx)));
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/stream_fuse.rs
Expand Up @@ -13,7 +13,7 @@ impl Stream for Alternate {

fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<i32>> {
let val = self.state;
self.state = self.state + 1;
self.state += 1;

// if it's even, Some(i32), else None
if val % 2 == 0 {
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/sync_rwlock.rs
Expand Up @@ -103,7 +103,7 @@ fn write_read_shared_pending() {
assert_ready!(t2.poll());

let mut t3 = spawn(rwlock.write());
let mut _g2 = assert_pending!(t3.poll());
assert_pending!(t3.poll());

let mut t4 = spawn(rwlock.read());
assert_pending!(t4.poll());
Expand Down

0 comments on commit bd8971c

Please sign in to comment.