2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-04-14 20:36:44 +00:00

Rename: extend_with_stream => stream_extend

This commit is contained in:
Wonwoo Choi 2019-09-19 18:34:31 +09:00
parent a5a6dc24c4
commit 9c00d0b903
2 changed files with 4 additions and 4 deletions

View file

@ -21,7 +21,7 @@ use crate::stream::{IntoStream, Stream};
///
/// let mut v: Vec<usize> = vec![1, 2];
/// 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]);
/// #
@ -30,14 +30,14 @@ use crate::stream::{IntoStream, Stream};
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
pub trait Extend<A> {
/// 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,
stream: T,
) -> Pin<Box<dyn Future<Output = ()> + 'a>>;
}
impl Extend<()> for () {
fn extend_with_stream<'a, T: IntoStream<Item = ()> + 'a>(
fn stream_extend<'a, T: IntoStream<Item = ()> + 'a>(
&'a mut self,
stream: T,
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {

View file

@ -4,7 +4,7 @@ use crate::future::Future;
use crate::stream::{Extend, IntoStream, Stream};
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,
stream: S,
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {