mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 19:23:50 +00:00
Implement FusedIterator
for std::net::[Into]Incoming
They never return `None`, so they trivially fulfill the contract.
This commit is contained in:
parent
07e7b4346c
commit
369555c85a
@ -7,6 +7,7 @@ use crate::io::prelude::*;
|
|||||||
|
|
||||||
use crate::fmt;
|
use crate::fmt;
|
||||||
use crate::io::{self, IoSlice, IoSliceMut};
|
use crate::io::{self, IoSlice, IoSliceMut};
|
||||||
|
use crate::iter::FusedIterator;
|
||||||
use crate::net::{Shutdown, SocketAddr, ToSocketAddrs};
|
use crate::net::{Shutdown, SocketAddr, ToSocketAddrs};
|
||||||
use crate::sys_common::net as net_imp;
|
use crate::sys_common::net as net_imp;
|
||||||
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
use crate::sys_common::{AsInner, FromInner, IntoInner};
|
||||||
@ -1009,6 +1010,9 @@ impl<'a> Iterator for Incoming<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[stable(feature = "tcp_listener_incoming_fused_iterator", since = "1.63.0")]
|
||||||
|
impl FusedIterator for Incoming<'_> {}
|
||||||
|
|
||||||
#[unstable(feature = "tcplistener_into_incoming", issue = "88339")]
|
#[unstable(feature = "tcplistener_into_incoming", issue = "88339")]
|
||||||
impl Iterator for IntoIncoming {
|
impl Iterator for IntoIncoming {
|
||||||
type Item = io::Result<TcpStream>;
|
type Item = io::Result<TcpStream>;
|
||||||
@ -1017,6 +1021,9 @@ impl Iterator for IntoIncoming {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[unstable(feature = "tcplistener_into_incoming", issue = "88339")]
|
||||||
|
impl FusedIterator for IntoIncoming {}
|
||||||
|
|
||||||
impl AsInner<net_imp::TcpListener> for TcpListener {
|
impl AsInner<net_imp::TcpListener> for TcpListener {
|
||||||
fn as_inner(&self) -> &net_imp::TcpListener {
|
fn as_inner(&self) -> &net_imp::TcpListener {
|
||||||
&self.0
|
&self.0
|
||||||
|
Loading…
Reference in New Issue
Block a user