Skip to content

Commit

Permalink
Remove futures-core dependency from futures-sink
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed Aug 27, 2019
1 parent 40c32d0 commit b9bcedf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit b9bcedf

Please sign in to comment.