Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbebebe0

Browse files
committed
silence warnings reported by newer rust versions
1 parent19ccd34 commitbebebe0

File tree

13 files changed

+26
-22
lines changed

13 files changed

+26
-22
lines changed

‎examples/a-chat/server.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ async fn connection_writer_loop(
9696
None =>break,
9797
},
9898
void = shutdown.next().fuse() =>match void{
99+
#[allow(unreachable_patterns)]
99100
Some(void) =>match void{},
100101
None =>break,
101102
}

‎src/future/future/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub use core::future::Future as Future;
2727
2828
[`Future`]: ../future/trait.Future.html
2929
"#]
30+
#[cfg(any(feature ="std", feature ="docs"))]
3031
pubtraitFutureExt:Future{
3132
/// Returns a Future that delays execution for a specified time.
3233
///
@@ -284,5 +285,6 @@ pub trait FutureExt: Future {
284285
}
285286
}
286287

288+
#[cfg(any(feature ="std", feature ="docs"))]
287289
impl<T:Future + ?Sized>FutureExtforT{}
288290

‎src/io/buf_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pin_project! {
114114
/// # Ok(()) }) }
115115
///```
116116
#[derive(Debug)]
117-
pubstructIntoInnerError<W>(W,crate::io::Error);
117+
pubstructIntoInnerError<W>(W,#[allow(dead_code)]crate::io::Error);
118118

119119
impl<W:Write>BufWriter<W>{
120120
/// Creates a new `BufWriter` with a default buffer capacity. The default is currently 8 KB,

‎src/io/read/bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<T: Read + Unpin> Stream for Bytes<T> {
3232
}
3333
}
3434

35-
#[cfg(all(test,default))]
35+
#[cfg(all(test,feature ="default"))]
3636
mod tests{
3737
usecrate::io;
3838
usecrate::prelude::*;

‎src/io/read/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl<T: BufRead, U: BufRead> BufRead for Chain<T, U> {
165165
}
166166
}
167167

168-
#[cfg(all(test,default))]
168+
#[cfg(all(test,feature ="default"))]
169169
mod tests{
170170
usecrate::io;
171171
usecrate::prelude::*;

‎src/io/stderr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ cfg_windows! {
204204
}
205205

206206
cfg_io_safety!{
207-
usecrate::os::unix::io::{AsHandle,BorrowedHandle};
207+
usecrate::os::windows::io::{AsHandle,BorrowedHandle};
208208

209209
implAsHandleforStderr{
210210
fn as_handle(&self) ->BorrowedHandle<'_>{
211-
std::io::stderr().as_handle()
211+
unsafe{
212+
BorrowedHandle::borrow_raw(std::io::stderr().as_raw_handle())
213+
}
212214
}
213215
}
214216
}

‎src/io/stdin.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,13 @@ cfg_windows! {
230230
}
231231

232232
cfg_io_safety!{
233-
usecrate::os::unix::io::{AsFd,BorrowedFd};
233+
usecrate::os::windows::io::{AsHandle,BorrowedHandle};
234234

235-
implAsFdforStdin{
236-
fn as_fd(&self) ->BorrowedFd<'_>{
237-
std::io::stdin().as_fd()
235+
implAsHandleforStdin{
236+
fn as_handle(&self) ->BorrowedHandle<'_>{
237+
unsafe{
238+
BorrowedHandle::borrow_raw(std::io::stdin().as_raw_handle())
239+
}
238240
}
239241
}
240242
}

‎src/io/stdout.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ cfg_windows! {
204204
}
205205

206206
cfg_io_safety!{
207-
usecrate::os::unix::io::{AsHandle,BorrowedHandle};
207+
usecrate::os::windows::io::{AsHandle,BorrowedHandle};
208208

209209
implAsHandleforStdout{
210210
fn as_handle(&self) ->BorrowedHandle<'_>{
211-
std::io::stdout().as_handle()
211+
unsafe{
212+
BorrowedHandle::borrow_raw(std::io::stdout().as_raw_handle())
213+
}
212214
}
213215
}
214216
}

‎src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@
284284
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
285285
#![doc(html_logo_url ="https://async.rs/images/logo--hero.svg")]
286286

287-
externcrate alloc;
288-
289287
#[macro_use]
290288
mod utils;
291289

‎src/net/tcp/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,13 @@ cfg_windows! {
477477

478478
implFrom<OwnedSocket>forTcpStream{
479479
fn from(fd:OwnedSocket) ->TcpStream{
480-
std::net::TcpListener::from(fd).into()
480+
std::net::TcpStream::from(fd).into()
481481
}
482482
}
483483

484484
implFrom<TcpStream>forOwnedSocket{
485485
fn from(stream:TcpStream) ->OwnedSocket{
486-
stream.watcher.into_inner().unwrap().into()
486+
stream.watcher.get_ref().try_clone().unwrap().into()
487487
}
488488
}
489489
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp