2024-04-14 automated rustfmt nightly

This commit is contained in:
Fmt Bot 2024-04-14 01:21:26 +00:00 committed by github-actions[bot]
parent 52080a0853
commit 410fd892e9
1 changed files with 1 additions and 2 deletions

View File

@ -211,8 +211,7 @@ impl<T: AsRef<[u8]>> Read for Cursor<T> {
let start_pos = self.pos.try_into().unwrap_or(inner.len()); let start_pos = self.pos.try_into().unwrap_or(inner.len());
let read = core::cmp::min(inner.len().saturating_sub(start_pos), buf.len()); let read = core::cmp::min(inner.len().saturating_sub(start_pos), buf.len());
buf[..read].copy_from_slice(&inner[start_pos..start_pos + read]); buf[..read].copy_from_slice(&inner[start_pos..start_pos + read]);
self.pos = self.pos = self.pos.saturating_add(read.try_into().unwrap_or(u64::MAX /* unreachable */));
self.pos.saturating_add(read.try_into().unwrap_or(u64::MAX /* unreachable */));
Ok(read) Ok(read)
} }
} }