mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
chore: update CI to clippy 1.76 (#6334)
Co-authored-by: Rafael Bachmann <rafael.bachmann.93@gmail.com>
This commit is contained in:
parent
0fbde0e94b
commit
e392c4ff1e
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -16,7 +16,7 @@ env:
|
||||
# Change to specific Rust release to pin
|
||||
rust_stable: stable
|
||||
rust_nightly: nightly-2023-10-21
|
||||
rust_clippy: '1.75'
|
||||
rust_clippy: '1.76'
|
||||
# When updating this, also update:
|
||||
# - README.md
|
||||
# - tokio/README.md
|
||||
|
@ -149,7 +149,7 @@ When updating this, also update:
|
||||
-->
|
||||
|
||||
```
|
||||
cargo +1.75 clippy --all --tests --all-features
|
||||
cargo +1.76 clippy --all --tests --all-features
|
||||
```
|
||||
|
||||
When building documentation normally, the markers that list the features
|
||||
|
@ -64,7 +64,7 @@ impl SlowHddWriter {
|
||||
) -> std::task::Poll<Result<(), std::io::Error>> {
|
||||
// If we hit a service interval, the buffer can be cleared
|
||||
let res = self.service_intervals.poll_tick(cx).map(|_| Ok(()));
|
||||
if let Poll::Ready(_) = res {
|
||||
if res.is_ready() {
|
||||
self.buffer_used = 0;
|
||||
}
|
||||
res
|
||||
@ -123,7 +123,7 @@ impl AsyncWrite for SlowHddWriter {
|
||||
cx: &mut std::task::Context<'_>,
|
||||
bufs: &[std::io::IoSlice<'_>],
|
||||
) -> std::task::Poll<Result<usize, std::io::Error>> {
|
||||
let writeable = bufs.into_iter().fold(0, |acc, buf| acc + buf.len());
|
||||
let writeable = bufs.iter().fold(0, |acc, buf| acc + buf.len());
|
||||
self.write_bytes(cx, writeable)
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ fn rt_multi_spawn_many_local(c: &mut Criterion) {
|
||||
});
|
||||
}
|
||||
|
||||
let _ = rx.recv().unwrap();
|
||||
rx.recv().unwrap();
|
||||
});
|
||||
})
|
||||
});
|
||||
@ -165,7 +165,7 @@ fn rt_multi_yield_many(c: &mut Criterion) {
|
||||
}
|
||||
|
||||
for _ in 0..TASKS {
|
||||
let _ = rx.recv().unwrap();
|
||||
rx.recv().unwrap();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ fn contention_impl<const N_TASKS: usize>(g: &mut BenchmarkGroup<WallTime>) {
|
||||
let mut rx = tx.subscribe();
|
||||
let mut rng = rand::rngs::StdRng::seed_from_u64(n as u64);
|
||||
rt.spawn(async move {
|
||||
while let Ok(_) = rx.recv().await {
|
||||
while (rx.recv().await).is_ok() {
|
||||
let r = do_work(&mut rng);
|
||||
let _ = black_box(r);
|
||||
if wg.0.fetch_sub(1, Ordering::Relaxed) == 1 {
|
||||
|
@ -23,7 +23,7 @@ fn main() {
|
||||
|
||||
// Without the `HandleExt.wrap()` there would be a panic because there is
|
||||
// no timer running, since it would be referencing runtime r1.
|
||||
let _ = rt1.block_on(rt2.wrap(async move {
|
||||
rt1.block_on(rt2.wrap(async move {
|
||||
let listener = TcpListener::bind("0.0.0.0:0").await.unwrap();
|
||||
println!("addr: {:?}", listener.local_addr());
|
||||
tx.send(()).unwrap();
|
||||
|
@ -42,7 +42,7 @@ fn main() {
|
||||
.write_all(one_mega_random_bytes.as_slice())
|
||||
.await
|
||||
.unwrap();
|
||||
stream.read(&mut buff).await.unwrap();
|
||||
let _ = stream.read(&mut buff).await.unwrap();
|
||||
}
|
||||
tx.send(()).unwrap();
|
||||
});
|
||||
|
@ -218,6 +218,7 @@ where
|
||||
// Make sure we've got room for at least one byte to read to ensure
|
||||
// that we don't get a spurious 0 that looks like EOF.
|
||||
state.buffer.reserve(1);
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let bytect = match poll_read_buf(pinned.inner.as_mut(), cx, &mut state.buffer).map_err(
|
||||
|err| {
|
||||
trace!("Got an error, going to errored state");
|
||||
|
@ -804,6 +804,7 @@ impl UdpSocket {
|
||||
///
|
||||
/// [`connect`]: method@Self::connect
|
||||
pub fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<io::Result<()>> {
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let n = ready!(self.io.registration().poll_read_io(cx, || {
|
||||
// Safety: will not read the maybe uninitialized bytes.
|
||||
let b = unsafe {
|
||||
@ -1340,6 +1341,7 @@ impl UdpSocket {
|
||||
cx: &mut Context<'_>,
|
||||
buf: &mut ReadBuf<'_>,
|
||||
) -> Poll<io::Result<SocketAddr>> {
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let (n, addr) = ready!(self.io.registration().poll_read_io(cx, || {
|
||||
// Safety: will not read the maybe uninitialized bytes.
|
||||
let b = unsafe {
|
||||
@ -1595,6 +1597,7 @@ impl UdpSocket {
|
||||
cx: &mut Context<'_>,
|
||||
buf: &mut ReadBuf<'_>,
|
||||
) -> Poll<io::Result<SocketAddr>> {
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let (n, addr) = ready!(self.io.registration().poll_read_io(cx, || {
|
||||
// Safety: will not read the maybe uninitialized bytes.
|
||||
let b = unsafe {
|
||||
|
@ -1161,6 +1161,7 @@ impl UnixDatagram {
|
||||
cx: &mut Context<'_>,
|
||||
buf: &mut ReadBuf<'_>,
|
||||
) -> Poll<io::Result<SocketAddr>> {
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let (n, addr) = ready!(self.io.registration().poll_read_io(cx, || {
|
||||
// Safety: will not read the maybe uninitialized bytes.
|
||||
let b = unsafe {
|
||||
@ -1262,6 +1263,7 @@ impl UnixDatagram {
|
||||
///
|
||||
/// [`connect`]: method@Self::connect
|
||||
pub fn poll_recv(&self, cx: &mut Context<'_>, buf: &mut ReadBuf<'_>) -> Poll<io::Result<()>> {
|
||||
#[allow(clippy::blocks_in_conditions)]
|
||||
let n = ready!(self.io.registration().poll_read_io(cx, || {
|
||||
// Safety: will not read the maybe uninitialized bytes.
|
||||
let b = unsafe {
|
||||
|
Loading…
x
Reference in New Issue
Block a user