Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove futures-core dependency from futures-sink #1832

Merged
merged 1 commit into from Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions futures-sink/Cargo.toml
Expand Up @@ -16,8 +16,7 @@ name = "futures_sink"

[features]
default = ["std"]
std = ["alloc", "futures-core-preview/std"]
alloc = ["futures-core-preview/alloc"]
std = ["alloc"]
alloc = []

[dependencies]
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.18", default-features = false }
7 changes: 3 additions & 4 deletions futures-sink/src/lib.rs
Expand Up @@ -16,9 +16,9 @@
#[cfg(feature = "alloc")]
extern crate alloc;

use futures_core::task::{Context, Poll};
use core::ops::DerefMut;
use core::pin::Pin;
use core::task::{Context, Poll};

/// A `Sink` is a value into which other values can be sent, asynchronously.
///
Expand Down Expand Up @@ -84,8 +84,7 @@ pub trait Sink<Item> {
///
/// In most cases, if the sink encounters an error, the sink will
/// permanently be unable to receive items.
fn start_send(self: Pin<&mut Self>, item: Item)
-> Result<(), Self::Error>;
fn start_send(self: Pin<&mut Self>, item: Item) -> Result<(), Self::Error>;

/// Flush any remaining output from this sink.
///
Expand Down Expand Up @@ -162,7 +161,7 @@ where
#[cfg(feature = "alloc")]
mod if_alloc {
use super::*;
use futures_core::never::Never;
use core::convert::Infallible as Never;

impl<T> Sink<T> for alloc::vec::Vec<T> {
type Error = Never;
Expand Down