We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 944e43d commit 2abf5caCopy full SHA for 2abf5ca
.github/workflows/ci.yml
@@ -11,6 +11,8 @@ jobs:
11
build_and_test:
12
name: Build and test
13
runs-on: ${{ matrix.os }}
14
+ env:
15
+ RUSTFLAGS: -Dwarnings
16
strategy:
17
matrix:
18
os: [ubuntu-latest, windows-latest, macOS-latest]
@@ -46,6 +48,8 @@ jobs:
46
48
check_fmt_and_docs:
47
49
name: Checking fmt and docs
50
runs-on: ubuntu-latest
51
52
53
steps:
54
- uses: actions/checkout@master
55
@@ -77,6 +81,9 @@ jobs:
77
81
clippy_check:
78
82
name: Clippy check
79
83
84
+ # TODO: There is a lot of warnings
85
+ # env:
86
+ # RUSTFLAGS: -Dwarnings
80
87
88
- uses: actions/checkout@v1
89
- id: component
src/io/timeout.rs
@@ -71,7 +71,7 @@ where
71
}
72
73
if this.timeout.poll(cx).is_ready() {
74
- let err = Err(io::Error::new(io::ErrorKind::TimedOut, "future timed out").into());
+ let err = Err(io::Error::new(io::ErrorKind::TimedOut, "future timed out"));
75
Poll::Ready(err)
76
} else {
Poll::Pending
src/io/write/write_fmt.rs
@@ -32,15 +32,15 @@ impl<T: Write + Unpin + ?Sized> Future for WriteFmtFuture<'_, T> {
32
buffer,
33
..
34
} = &mut *self;
35
- let mutbuffer = buffer.as_mut().unwrap();
+ let buffer = buffer.as_mut().unwrap();
36
37
// Copy the data from the buffer into the writer until it's done.
38
loop {
39
if *amt == buffer.len() as u64 {
40
futures_core::ready!(Pin::new(&mut **writer).poll_flush(cx))?;
41
return Poll::Ready(Ok(()));
42
43
- let i = futures_core::ready!(Pin::new(&mut **writer).poll_write(cx, &mutbuffer))?;
+ let i = futures_core::ready!(Pin::new(&mut **writer).poll_write(cx, buffer))?;
44
if i == 0 {
45
return Poll::Ready(Err(io::ErrorKind::WriteZero.into()));
src/net/addr.rs
@@ -210,7 +210,7 @@ impl ToSocketAddrs for str {
210
impl Future<Output = Self::Iter>,
211
ToSocketAddrsFuture<Self::Iter>
212
) {
213
- if let Some(addr) = self.parse().ok() {
+ if let Ok(addr) = self.parse() {
214
return ToSocketAddrsFuture::Ready(Ok(vec![addr].into_iter()));
215
216
src/path/path.rs
@@ -799,7 +799,7 @@ impl AsRef<Path> for String {
799
800
impl AsRef<Path> for std::path::PathBuf {
801
fn as_ref(&self) -> &Path {
802
- Path::new(self.into())
+ Path::new(self)
803
804
805
src/path/pathbuf.rs
@@ -5,7 +5,7 @@ use crate::path::Path;
5
/// This struct is an async version of [`std::path::PathBuf`].
6
///
7
/// [`std::path::Path`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html
8
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq,Default)]
9
pub struct PathBuf {
10
inner: std::path::PathBuf,
@@ -206,7 +206,7 @@ impl From<std::path::PathBuf> for PathBuf {
206
207
impl Into<std::path::PathBuf> for PathBuf {
208
fn into(self) -> std::path::PathBuf {
209
- self.inner.into()
+ self.inner
src/stream/exact_size_stream.rs
@@ -59,7 +59,7 @@ pub use crate::stream::Stream;
59
/// # }
60
61
62
-/// # fn main() { async_std::task::block_on(async {
+/// # async_std::task::block_on(async {
63
/// #
64
/// impl ExactSizeStream for Counter {
65
/// // We can easily calculate the remaining number of iterations.
@@ -74,7 +74,6 @@ pub use crate::stream::Stream;
/// assert_eq!(5, counter.len());
/// # });
-/// # }
/// ```
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
src/stream/extend.rs
@@ -14,7 +14,7 @@ use crate::stream::IntoStream;
/// ## Examples
19
/// use async_std::prelude::*;
20
/// use async_std::stream::{self, Extend};
@@ -25,7 +25,7 @@ use crate::stream::IntoStream;
25
26
/// assert_eq!(v, vec![1, 2, 3, 3, 3]);
27
28
-/// # }) }
+/// # })
29
30
31
src/stream/from_fn.rs
@@ -30,7 +30,7 @@ pin_project! {
/// # Examples
/// use async_std::sync::Mutex;
@@ -58,8 +58,7 @@ pin_project! {
58
/// assert_eq!(s.next().await, Some(3));
/// assert_eq!(s.next().await, None);
-///
pub fn from_fn<T, F, Fut>(f: F) -> FromFn<F, Fut, T>
where
src/stream/repeat_with.rs
@@ -29,7 +29,7 @@ pin_project! {
/// Basic usage:
/// use async_std::stream;
@@ -42,13 +42,13 @@ pin_project! {
/// assert_eq!(s.next().await, Some(1));
/// Going finite:
@@ -60,7 +60,7 @@ pin_project! {
pub fn repeat_with<F, Fut, A>(repeater: F) -> RepeatWith<F, Fut, A>
66
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments