feat: Make the stream module no_std

split-by-pattern
k-nasa 5 years ago
parent 880b7ee987
commit d622ec5d35

@ -42,13 +42,13 @@ std = [
"futures-io", "futures-io",
"memchr", "memchr",
"once_cell", "once_cell",
"pin-project-lite",
"pin-utils", "pin-utils",
"slab", "slab",
"no-std", "no-std",
] ]
no-std = [ no-std = [
"futures-core", "futures-core",
"pin-project-lite",
] ]
[dependencies] [dependencies]

@ -244,13 +244,13 @@ mod macros;
cfg_no_std! { cfg_no_std! {
pub mod task; pub mod task;
pub mod future; pub mod future;
pub mod stream;
} }
cfg_std! { cfg_std! {
pub mod io; pub mod io;
pub mod os; pub mod os;
pub mod prelude; pub mod prelude;
pub mod stream;
pub mod sync; pub mod sync;
} }

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use crate::stream::DoubleEndedStream; use crate::stream::DoubleEndedStream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use crate::stream::DoubleEndedStream; use crate::stream::DoubleEndedStream;

@ -1,6 +1,6 @@
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::DoubleEndedStream; use crate::stream::DoubleEndedStream;

@ -1,6 +1,6 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use crate::future::Future; use crate::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use crate::future::Future; use crate::future::Future;
use crate::stream::IntoStream; use crate::stream::IntoStream;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::IntoStream; use crate::stream::IntoStream;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream, Stream}; use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream, Stream};

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use crate::stream::Stream; use crate::stream::Stream;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,7 +1,7 @@
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
use std::pin::Pin; use core::pin::Pin;
pin_project! { pin_project! {
/// A stream that clones the elements of an underlying stream. /// A stream that clones the elements of an underlying stream.

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,7 +1,7 @@
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
use std::pin::Pin; use core::pin::Pin;
pin_project! { pin_project! {
/// A stream that copies the elements of an underlying stream. /// A stream that copies the elements of an underlying stream.

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::mem::ManuallyDrop; use core::mem::ManuallyDrop;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use std::time::Duration; use core::time::Duration;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use crate::stream::Stream; use crate::stream::Stream;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::fmt; use core::fmt;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,7 +1,7 @@
use std::cmp::{Ord, Ordering}; use core::cmp::{Ord, Ordering};
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,7 +1,7 @@
use std::cmp::{Ord, Ordering}; use core::cmp::{Ord, Ordering};
use std::marker::PhantomData; use core::marker::PhantomData;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -110,12 +110,12 @@ pub use take::Take;
pub use take_while::TakeWhile; pub use take_while::TakeWhile;
pub use zip::Zip; pub use zip::Zip;
use std::cmp::Ordering; use core::cmp::Ordering;
cfg_unstable! { cfg_unstable! {
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use std::time::Duration; use core::time::Duration;
use crate::stream::into_stream::IntoStream; use crate::stream::into_stream::IntoStream;
use crate::stream::{FromStream, Product, Sum}; use crate::stream::{FromStream, Product, Sum};

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::future::Future; use core::future::Future;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,6 +1,6 @@
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use std::future::Future; use core::future::Future;
use crate::stream::Stream; use crate::stream::Stream;

@ -1,6 +1,6 @@
use std::cmp::Ordering; use core::cmp::Ordering;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,7 +1,7 @@
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
use std::default::Default; use core::default::Default;
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::pin::Pin; use core::pin::Pin;
use std::task::{Context, Poll}; use core::task::{Context, Poll};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,8 +1,8 @@
use std::error::Error; use std::error::Error;
use std::fmt; use std::fmt;
use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::time::Duration; use std::time::Duration;
use std::future::Future;
use futures_timer::Delay; use futures_timer::Delay;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,4 +1,4 @@
use std::pin::Pin; use core::pin::Pin;
use crate::future::Future; use crate::future::Future;
use crate::stream::Stream; use crate::stream::Stream;

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::fmt; use core::fmt;
use std::pin::Pin; use core::pin::Pin;
use pin_project_lite::pin_project; use pin_project_lite::pin_project;

@ -1,5 +1,5 @@
use std::mem; use core::mem;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;
use crate::task::{Context, Poll}; use crate::task::{Context, Poll};

@ -1,5 +1,5 @@
use std::future::Future; use core::future::Future;
use std::pin::Pin; use core::pin::Pin;
use crate::stream::Stream; use crate::stream::Stream;

Loading…
Cancel
Save