Skip to content

Commit f0bf66d

Browse files
committed
Update futures-preview to 0.3.0-alpha.19
1 parent 155256c commit f0bf66d

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

Cargo.toml

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ async-task = "1.0.0"
3030
cfg-if = "0.1.9"
3131
crossbeam-channel = "0.3.9"
3232
crossbeam-deque = "0.7.1"
33-
futures-core-preview = "=0.3.0-alpha.18"
34-
futures-io-preview = "=0.3.0-alpha.18"
33+
futures-core-preview = "=0.3.0-alpha.19"
34+
futures-io-preview = "=0.3.0-alpha.19"
3535
futures-timer = "0.4.0"
3636
lazy_static = "1.4.0"
3737
log = { version = "0.4.8", features = ["kv_unstable"] }
@@ -48,11 +48,11 @@ broadcaster = { version = "0.2.6", optional = true, default-features = false, fe
4848
femme = "1.2.0"
4949
surf = "1.0.2"
5050
tempdir = "0.3.7"
51+
futures-preview = { version = "=0.3.0-alpha.19", features = ["async-await"] }
5152

5253
# These are used by the book for examples
53-
futures-channel-preview = "=0.3.0-alpha.18"
54-
futures-util-preview = "=0.3.0-alpha.18"
54+
futures-channel-preview = "=0.3.0-alpha.19"
55+
futures-util-preview = "=0.3.0-alpha.19"
5556

56-
[dev-dependencies.futures-preview]
57-
version = "=0.3.0-alpha.18"
58-
features = ["std", "nightly", "async-await"]
57+
[patch.crates-io]
58+
surf = { git = "https://github.com/taiki-e/surf", branch = "futures" }

docs/src/tutorial/specification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ Add the following lines to `Cargo.toml`:
5050

5151
```toml
5252
[dependencies]
53-
futures-preview = { version = "0.3.0-alpha.18", features = [ "async-await", "nightly" ] }
53+
futures-preview = { version = "0.3.0-alpha.19", features = [ "async-await" ] }
5454
async-std = "0.99"
5555
```

src/io/read/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ extension_trait! {
461461
}
462462
}
463463

464+
/// Initializes a buffer if necessary.
465+
///
466+
/// Currently, a buffer is always initialized because `read_initializer`
467+
/// feature is not stable.
468+
#[inline]
469+
unsafe fn initialize<R: futures_io::AsyncRead>(_reader: &R, buf: &mut [u8]) {
470+
std::ptr::write_bytes(buf.as_mut_ptr(), 0, buf.len())
471+
}
472+
464473
#[cfg(test)]
465474
mod tests {
466475
use crate::io;

src/io/read/read_to_end.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn read_to_end_internal<R: Read + ?Sized>(
6464
g.buf.reserve(32);
6565
let capacity = g.buf.capacity();
6666
g.buf.set_len(capacity);
67-
rd.initializer().initialize(&mut g.buf[g.len..]);
67+
super::initialize(&rd, &mut g.buf[g.len..]);
6868
}
6969
}
7070

0 commit comments

Comments
 (0)