Skip to content

Commit 98c79f4

Browse files
bors[bot]taiki-e
andauthored
Merge #255
255: Update futures-preview to 0.3.0-alpha.19 r=skade a=taiki-e Depends on http-rs/surf#74 Refs: * rust-lang/futures-rs#1761 * rust-lang/futures-rs#1845 cc @skade @stjepang @yoshuawuyts Co-authored-by: Taiki Endo <[email protected]>
2 parents a97a1ff + 77ebedd commit 98c79f4

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

Cargo.toml

+6-9
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"] }
@@ -46,13 +46,10 @@ broadcaster = { version = "0.2.6", optional = true, default-features = false, fe
4646

4747
[dev-dependencies]
4848
femme = "1.2.0"
49-
surf = "1.0.2"
49+
# 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"
55-
56-
[dev-dependencies.futures-preview]
57-
version = "=0.3.0-alpha.18"
58-
features = ["std", "nightly", "async-await"]
54+
futures-channel-preview = "=0.3.0-alpha.19"
55+
futures-util-preview = "=0.3.0-alpha.19"

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
```

examples/surf-web.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* TODO: Once the next version of surf released, re-enable this example.
12
//! Sends an HTTP request to the Rust website.
23
34
use async_std::task;
@@ -17,3 +18,6 @@ fn main() -> Result<(), surf::Exception> {
1718
Ok(())
1819
})
1920
}
21+
*/
22+
23+
fn main() {}

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)