We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6d2a43e + d60e7cc commit 0ec027dCopy full SHA for 0ec027d
src/fs/file.rs
@@ -673,7 +673,7 @@ impl LockGuard<State> {
673
if available > 0 || self.cache.is_empty() {
674
// Copy data from the cache into the buffer.
675
let n = cmp::min(available, buf.len());
676
- buf[..n].copy_from_slice(&self.cache[start..n]);
+ buf[..n].copy_from_slice(&self.cache[start..(start + n)]);
677
678
// Move the read cursor forward.
679
self.mode = Mode::Reading(start + n);
0 commit comments