about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-07 08:46:45 +0000
committerbors <bors@rust-lang.org>2018-12-07 08:46:45 +0000
commitfc84f5f837a3e1b9b9bc992dd603d3d968502288 (patch)
tree9e64c02fb9f8084d26a6a743c62ac54626e549d3 /src/libstd/io
parent15a2607863fded7570cacfc7825702dde5a4234c (diff)
parenta40aa45980f45e26a227a889a69b54bcfcd68eba (diff)
downloadrust-fc84f5f837a3e1b9b9bc992dd603d3d968502288.tar.gz
rust-fc84f5f837a3e1b9b9bc992dd603d3d968502288.zip
Auto merge of #56581 - kennytm:rollup, r=kennytm
Rollup of 7 pull requests

Successful merges:

 - #56000 (Add Armv8-M Mainline targets)
 - #56250 (Introduce ptr::hash for references)
 - #56434 (Improve query cycle errors for parallel queries)
 - #56516 (Replace usages of `..i + 1` ranges with `..=i`.)
 - #56555 (Send textual profile data to stderr, not stdout)
 - #56561 (Fix bug in from_key_hashed_nocheck)
 - #56574 (Fix a stutter in the docs for slice::exact_chunks)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/buffered.rs2
-rw-r--r--src/libstd/io/mod.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/io/buffered.rs b/src/libstd/io/buffered.rs
index 476ee3f71ca..7ede050da6c 100644
--- a/src/libstd/io/buffered.rs
+++ b/src/libstd/io/buffered.rs
@@ -918,7 +918,7 @@ impl<W: Write> Write for LineWriter<W> {
         // some data then we *must* report that we wrote that data, so future
         // errors are ignored. We set our internal `need_flush` flag, though, in
         // case flushing fails and we need to try it first next time.
-        let n = self.inner.write(&buf[..i + 1])?;
+        let n = self.inner.write(&buf[..=i])?;
         self.need_flush = true;
         if self.flush().is_err() || n != i + 1 {
             return Ok(n)
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 076524e624a..dc97701d889 100644
--- a/src/libstd/io/mod.rs
+++ b/src/libstd/io/mod.rs
@@ -1261,7 +1261,7 @@ fn read_until<R: BufRead + ?Sized>(r: &mut R, delim: u8, buf: &mut Vec<u8>)
             };
             match memchr::memchr(delim, available) {
                 Some(i) => {
-                    buf.extend_from_slice(&available[..i + 1]);
+                    buf.extend_from_slice(&available[..=i]);
                     (true, i + 1)
                 }
                 None => {