Skip to content

Commit

Permalink
chore: update CI's clippy version to 1.65 (#5276)
Browse files Browse the repository at this point in the history
  • Loading branch information
carllerche committed Dec 7, 2022
1 parent 07da5e7 commit 22cff80
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -12,7 +12,7 @@ env:
# Change to specific Rust release to pin
rust_stable: stable
rust_nightly: nightly-2022-11-03
rust_clippy: 1.60.0
rust_clippy: 1.65.0
# When updating this, also update:
# - README.md
# - tokio/README.md
Expand Down
4 changes: 2 additions & 2 deletions tokio-macros/src/select.rs
Expand Up @@ -100,10 +100,10 @@ fn clean_pattern(pat: &mut syn::Pat) {
}
syn::Pat::Reference(reference) => {
reference.mutability = None;
clean_pattern(&mut *reference.pat);
clean_pattern(&mut reference.pat);
}
syn::Pat::Type(type_pat) => {
clean_pattern(&mut *type_pat.pat);
clean_pattern(&mut type_pat.pat);
}
_ => {}
}
Expand Down
2 changes: 1 addition & 1 deletion tokio-stream/src/stream_ext/then.rs
Expand Up @@ -72,7 +72,7 @@ where
}

fn size_hint(&self) -> (usize, Option<usize>) {
let future_len = if self.future.is_some() { 1 } else { 0 };
let future_len = usize::from(self.future.is_some());
let (lower, upper) = self.stream.size_hint();

let lower = lower.saturating_add(future_len);
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/src/sync/poll_semaphore.rs
Expand Up @@ -166,6 +166,6 @@ impl fmt::Debug for PollSemaphore {

impl AsRef<Semaphore> for PollSemaphore {
fn as_ref(&self) -> &Semaphore {
&*self.semaphore
&self.semaphore
}
}
8 changes: 4 additions & 4 deletions tokio-util/tests/spawn_pinned.rs
Expand Up @@ -82,8 +82,8 @@ async fn task_panic_propagates() {
assert!(result.is_err());
let error = result.unwrap_err();
assert!(error.is_panic());
let panic_str: &str = *error.into_panic().downcast().unwrap();
assert_eq!(panic_str, "Test panic");
let panic_str = error.into_panic().downcast::<&'static str>().unwrap();
assert_eq!(*panic_str, "Test panic");

// Trying again with a "safe" task still works
let join_handle = pool.spawn_pinned(|| async { "test" });
Expand All @@ -108,8 +108,8 @@ async fn callback_panic_does_not_kill_worker() {
assert!(result.is_err());
let error = result.unwrap_err();
assert!(error.is_panic());
let panic_str: &str = *error.into_panic().downcast().unwrap();
assert_eq!(panic_str, "Test panic");
let panic_str = error.into_panic().downcast::<&'static str>().unwrap();
assert_eq!(*panic_str, "Test panic");

// Trying again with a "safe" callback works
let join_handle = pool.spawn_pinned(|| async { "test" });
Expand Down
2 changes: 1 addition & 1 deletion tokio-util/tests/time_delay_queue.rs
@@ -1,4 +1,4 @@
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]
#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]

Expand Down
2 changes: 1 addition & 1 deletion tokio/src/io/util/read.rs
Expand Up @@ -48,7 +48,7 @@ where

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<usize>> {
let me = self.project();
let mut buf = ReadBuf::new(*me.buf);
let mut buf = ReadBuf::new(me.buf);
ready!(Pin::new(me.reader).poll_read(cx, &mut buf))?;
Poll::Ready(Ok(buf.filled().len()))
}
Expand Down
4 changes: 2 additions & 2 deletions tokio/src/net/tcp/split_owned.rs
Expand Up @@ -490,12 +490,12 @@ impl AsyncWrite for OwnedWriteHalf {

impl AsRef<TcpStream> for OwnedReadHalf {
fn as_ref(&self) -> &TcpStream {
&*self.inner
&self.inner
}
}

impl AsRef<TcpStream> for OwnedWriteHalf {
fn as_ref(&self) -> &TcpStream {
&*self.inner
&self.inner
}
}
4 changes: 2 additions & 2 deletions tokio/src/net/unix/split_owned.rs
Expand Up @@ -398,12 +398,12 @@ impl AsyncWrite for OwnedWriteHalf {

impl AsRef<UnixStream> for OwnedReadHalf {
fn as_ref(&self) -> &UnixStream {
&*self.inner
&self.inner
}
}

impl AsRef<UnixStream> for OwnedWriteHalf {
fn as_ref(&self) -> &UnixStream {
&*self.inner
&self.inner
}
}
2 changes: 1 addition & 1 deletion tokio/src/runtime/scheduler/multi_thread/queue.rs
Expand Up @@ -263,7 +263,7 @@ impl<T> Local<T> {
// safety: The CAS above ensures that no consumer will look at these
// values again, and we are the only producer.
let batch_iter = BatchTaskIter {
buffer: &*self.inner.buffer,
buffer: &self.inner.buffer,
head: head as UnsignedLong,
i: 0,
};
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/runtime/task/harness.rs
Expand Up @@ -194,7 +194,7 @@ where
TransitionToRunning::Success => {
let header_ptr = self.header_ptr();
let waker_ref = waker_ref::<T, S>(&header_ptr);
let cx = Context::from_waker(&*waker_ref);
let cx = Context::from_waker(&waker_ref);
let res = poll_future(self.core(), cx);

if res == Poll::Ready(()) {
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/time/sleep.rs
Expand Up @@ -357,7 +357,7 @@ impl Sleep {
fn reset_inner(self: Pin<&mut Self>, deadline: Instant) {
let mut me = self.project();
me.entry.as_mut().reset(deadline);
(*me.inner).deadline = deadline;
(me.inner).deadline = deadline;

#[cfg(all(tokio_unstable, feature = "tracing"))]
{
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/util/linked_list.rs
Expand Up @@ -126,7 +126,7 @@ impl<L: Link> LinkedList<L, L::Target> {
pub(crate) fn push_front(&mut self, val: L::Handle) {
// The value should not be dropped, it is being inserted into the list
let val = ManuallyDrop::new(val);
let ptr = L::as_raw(&*val);
let ptr = L::as_raw(&val);
assert_ne!(self.head, Some(ptr));
unsafe {
L::pointers(ptr).as_mut().set_next(self.head);
Expand Down
4 changes: 2 additions & 2 deletions tokio/tests/buffered.rs
Expand Up @@ -18,10 +18,10 @@ async fn echo_server() {
let msg = "foo bar baz";

let t = thread::spawn(move || {
let mut s = assert_ok!(TcpStream::connect(&addr));
let mut s = assert_ok!(TcpStream::connect(addr));

let t2 = thread::spawn(move || {
let mut s = assert_ok!(TcpStream::connect(&addr));
let mut s = assert_ok!(TcpStream::connect(addr));
let mut b = vec![0; msg.len() * N];
assert_ok!(s.read_exact(&mut b));
b
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/io_driver.rs
Expand Up @@ -80,7 +80,7 @@ fn test_drop_on_notify() {
drop(task);

// Establish a connection to the acceptor
let _s = TcpStream::connect(&addr).unwrap();
let _s = TcpStream::connect(addr).unwrap();

// Force the reactor to turn
rt.block_on(async {});
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/macros_join.rs
@@ -1,5 +1,5 @@
#![cfg(feature = "macros")]
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]
use std::sync::Arc;

#[cfg(tokio_wasm_not_wasi)]
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/macros_select.rs
@@ -1,5 +1,5 @@
#![cfg(feature = "macros")]
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

#[cfg(tokio_wasm_not_wasi)]
use wasm_bindgen_test::wasm_bindgen_test as maybe_tokio_test;
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/macros_try_join.rs
@@ -1,5 +1,5 @@
#![cfg(feature = "macros")]
#![allow(clippy::blacklisted_name)]
#![allow(clippy::disallowed_names)]

use std::sync::Arc;

Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/rt_common.rs
Expand Up @@ -661,7 +661,7 @@ rt_test! {
loop {
// Don't use Tokio's `yield_now()` to avoid special defer
// logic.
let _: () = futures::future::poll_fn(|cx| {
futures::future::poll_fn::<(), _>(|cx| {
cx.waker().wake_by_ref();
std::task::Poll::Pending
}).await;
Expand Down
2 changes: 1 addition & 1 deletion tokio/tests/tcp_peek.rs
Expand Up @@ -15,7 +15,7 @@ async fn peek() {
let addr = listener.local_addr().unwrap();
let t = thread::spawn(move || assert_ok!(listener.accept()).0);

let left = net::TcpStream::connect(&addr).unwrap();
let left = net::TcpStream::connect(addr).unwrap();
let mut right = t.join().unwrap();
let _ = right.write(&[1, 2, 3, 4]).unwrap();

Expand Down

0 comments on commit 22cff80

Please sign in to comment.