Skip to content

Commit 93b01e3

Browse files
author
Stjepan Glavina
authored
Clippy fixes (#462)
1 parent d502453 commit 93b01e3

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

src/io/buf_read/read_line.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ impl<T: BufRead + Unpin + ?Sized> Future for ReadLineFuture<'_, T> {
3737
))
3838
}))
3939
} else {
40-
debug_assert!(buf.is_empty());
41-
debug_assert_eq!(*read, 0);
40+
#[allow(clippy::debug_assert_with_mut_call)]
41+
{
42+
debug_assert!(buf.is_empty());
43+
debug_assert_eq!(*read, 0);
44+
}
45+
4246
// Safety: `bytes` is a valid UTF-8 because `str::from_utf8` returned `Ok`.
4347
mem::swap(unsafe { buf.as_mut_vec() }, bytes);
4448
Poll::Ready(ret)

src/io/read/read_to_string.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ impl<T: Read + Unpin + ?Sized> Future for ReadToStringFuture<'_, T> {
3737
))
3838
}))
3939
} else {
40-
debug_assert!(buf.is_empty());
40+
#[allow(clippy::debug_assert_with_mut_call)]
41+
{
42+
debug_assert!(buf.is_empty());
43+
}
44+
4145
// Safety: `bytes` is a valid UTF-8 because `str::from_utf8` returned `Ok`.
4246
mem::swap(unsafe { buf.as_mut_vec() }, bytes);
4347
Poll::Ready(ret)

src/sync/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! Consider the following code, operating on some global static variables:
1717
//!
18-
//! ```rust
18+
//! ```
1919
//! static mut A: u32 = 0;
2020
//! static mut B: u32 = 0;
2121
//! static mut C: u32 = 0;
@@ -175,6 +175,8 @@
175175
//! # })
176176
//! ```
177177
178+
#![allow(clippy::needless_doctest_main)]
179+
178180
#[doc(inline)]
179181
pub use std::sync::{Arc, Weak};
180182

src/task/block_on.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ where
8989
static VTABLE: RawWakerVTable = {
9090
unsafe fn clone_raw(ptr: *const ()) -> RawWaker {
9191
let arc = ManuallyDrop::new(Arc::from_raw(ptr as *const Parker));
92+
#[allow(clippy::redundant_clone)]
9293
mem::forget(arc.clone());
9394
RawWaker::new(ptr, &VTABLE)
9495
}

0 commit comments

Comments
 (0)