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

Update futures-preview to 0.3.0-alpha.19 #255

Merged
merged 2 commits into from
Oct 1, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async-task = "1.0.0"
cfg-if = "0.1.9"
crossbeam-channel = "0.3.9"
crossbeam-deque = "0.7.1"
futures-core-preview = "=0.3.0-alpha.18"
futures-io-preview = "=0.3.0-alpha.18"
futures-core-preview = "=0.3.0-alpha.19"
futures-io-preview = "=0.3.0-alpha.19"
futures-timer = "0.4.0"
lazy_static = "1.4.0"
log = { version = "0.4.8", features = ["kv_unstable"] }
Expand All @@ -46,13 +46,10 @@ broadcaster = { version = "0.2.6", optional = true, default-features = false, fe

[dev-dependencies]
femme = "1.2.0"
surf = "1.0.2"
# surf = "1.0.2"
tempdir = "0.3.7"
futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
Copy link
Collaborator

@skade skade Sep 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also drop the async-await feature, we don't need it anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think examples/a-chat is still using it.

use futures::select;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, in this case, we should keep it.


# These are used by the book for examples
futures-channel-preview = "=0.3.0-alpha.18"
futures-util-preview = "=0.3.0-alpha.18"

[dev-dependencies.futures-preview]
version = "=0.3.0-alpha.18"
features = ["std", "nightly", "async-await"]
futures-channel-preview = "=0.3.0-alpha.19"
futures-util-preview = "=0.3.0-alpha.19"
2 changes: 1 addition & 1 deletion docs/src/tutorial/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ Add the following lines to `Cargo.toml`:

```toml
[dependencies]
futures-preview = { version = "0.3.0-alpha.18", features = [ "async-await", "nightly" ] }
futures-preview = { version = "0.3.0-alpha.19", features = [ "async-await" ] }
async-std = "0.99"
```
4 changes: 4 additions & 0 deletions examples/surf-web.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* TODO: Once the next version of surf released, re-enable this example.
//! Sends an HTTP request to the Rust website.

use async_std::task;
Expand All @@ -17,3 +18,6 @@ fn main() -> Result<(), surf::Exception> {
Ok(())
})
}
*/

fn main() {}
9 changes: 9 additions & 0 deletions src/io/read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ extension_trait! {
}
}

/// Initializes a buffer if necessary.
///
/// Currently, a buffer is always initialized because `read_initializer`
/// feature is not stable.
#[inline]
unsafe fn initialize<R: futures_io::AsyncRead>(_reader: &R, buf: &mut [u8]) {
std::ptr::write_bytes(buf.as_mut_ptr(), 0, buf.len())
}

#[cfg(test)]
mod tests {
use crate::io;
Expand Down
2 changes: 1 addition & 1 deletion src/io/read/read_to_end.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn read_to_end_internal<R: Read + ?Sized>(
g.buf.reserve(32);
let capacity = g.buf.capacity();
g.buf.set_len(capacity);
rd.initializer().initialize(&mut g.buf[g.len..]);
super::initialize(&rd, &mut g.buf[g.len..]);
}
}

Expand Down