forked from mirror/async-std
Rename: extend_with_stream => stream_extend
This commit is contained in:
parent
a5a6dc24c4
commit
9c00d0b903
2 changed files with 4 additions and 4 deletions
|
@ -21,7 +21,7 @@ use crate::stream::{IntoStream, Stream};
|
||||||
///
|
///
|
||||||
/// let mut v: Vec<usize> = vec![1, 2];
|
/// let mut v: Vec<usize> = vec![1, 2];
|
||||||
/// let s = stream::repeat(3usize).take(3);
|
/// let s = stream::repeat(3usize).take(3);
|
||||||
/// v.extend_with_stream(s).await;
|
/// v.stream_extend(s).await;
|
||||||
///
|
///
|
||||||
/// assert_eq!(v, vec![1, 2, 3, 3, 3]);
|
/// assert_eq!(v, vec![1, 2, 3, 3, 3]);
|
||||||
/// #
|
/// #
|
||||||
|
@ -30,14 +30,14 @@ use crate::stream::{IntoStream, Stream};
|
||||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||||
pub trait Extend<A> {
|
pub trait Extend<A> {
|
||||||
/// Extends a collection with the contents of a stream.
|
/// Extends a collection with the contents of a stream.
|
||||||
fn extend_with_stream<'a, T: IntoStream<Item = A> + 'a>(
|
fn stream_extend<'a, T: IntoStream<Item = A> + 'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
stream: T,
|
stream: T,
|
||||||
) -> Pin<Box<dyn Future<Output = ()> + 'a>>;
|
) -> Pin<Box<dyn Future<Output = ()> + 'a>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Extend<()> for () {
|
impl Extend<()> for () {
|
||||||
fn extend_with_stream<'a, T: IntoStream<Item = ()> + 'a>(
|
fn stream_extend<'a, T: IntoStream<Item = ()> + 'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
stream: T,
|
stream: T,
|
||||||
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
||||||
|
|
|
@ -4,7 +4,7 @@ use crate::future::Future;
|
||||||
use crate::stream::{Extend, IntoStream, Stream};
|
use crate::stream::{Extend, IntoStream, Stream};
|
||||||
|
|
||||||
impl<T> Extend<T> for Vec<T> {
|
impl<T> Extend<T> for Vec<T> {
|
||||||
fn extend_with_stream<'a, S: IntoStream<Item = T> + 'a>(
|
fn stream_extend<'a, S: IntoStream<Item = T> + 'a>(
|
||||||
&'a mut self,
|
&'a mut self,
|
||||||
stream: S,
|
stream: S,
|
||||||
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
||||||
|
|
Loading…
Reference in a new issue