Compare commits
4 Commits
54fbe4491c
...
ce2d464bb7
Author | SHA1 | Date |
---|---|---|
Øystein Olsen | ce2d464bb7 | |
John Nunley | cdf5d64e6f | |
Øystein Olsen | bc1fc998c0 | |
Øystein Olsen | 12169e5f12 |
|
@ -1,3 +1,7 @@
|
|||
# Version 2.3.0
|
||||
|
||||
- Add `StreamExt::drain` for draining objects from a `Stream` without waiting (#70).
|
||||
|
||||
# Version 2.2.0
|
||||
|
||||
- Relax `Unpin` bounds on `io::copy`. (#87)
|
||||
|
|
|
@ -3,7 +3,7 @@ name = "futures-lite"
|
|||
# When publishing a new version:
|
||||
# - Update CHANGELOG.md
|
||||
# - Create "v2.x.y" git tag
|
||||
version = "2.2.0"
|
||||
version = "2.3.0"
|
||||
authors = [
|
||||
"Stjepan Glavina <stjepang@gmail.com>",
|
||||
"Contributors to futures-rs",
|
||||
|
|
10
src/io.rs
10
src/io.rs
|
@ -1648,11 +1648,17 @@ pub trait AsyncBufReadExt: AsyncBufRead {
|
|||
/// use futures_lite::io::{AsyncBufReadExt, BufReader};
|
||||
///
|
||||
/// # spin_on::spin_on(async {
|
||||
/// let input: &[u8] = b"hello";
|
||||
/// let input: &[u8] = b"hello\nworld";
|
||||
/// let mut reader = BufReader::new(input);
|
||||
///
|
||||
/// let mut line = String::new();
|
||||
/// let n = reader.read_line(&mut line).await?;
|
||||
/// assert_eq!(n, 6);
|
||||
/// assert_eq!(line, "hello\n");
|
||||
///
|
||||
/// let n = reader.read_line(&mut line).await?;
|
||||
/// assert_eq!(n, 5);
|
||||
/// assert_eq!(line, "hello\nworld");
|
||||
/// # std::io::Result::Ok(()) });
|
||||
/// ```
|
||||
fn read_line<'a>(&'a mut self, buf: &'a mut String) -> ReadLineFuture<'_, Self>
|
||||
|
@ -1661,8 +1667,8 @@ pub trait AsyncBufReadExt: AsyncBufRead {
|
|||
{
|
||||
ReadLineFuture {
|
||||
reader: self,
|
||||
bytes: mem::take(buf).into_bytes(),
|
||||
buf,
|
||||
bytes: Vec::new(),
|
||||
read: 0,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue