Skip to content

Commit

Permalink
Merge rust-bitcoin#2683: Automated nightly rustfmt (2024-04-14)
Browse files Browse the repository at this point in the history
410fd89 2024-04-14 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 410fd89 one line, nice

Tree-SHA512: dadf7c46f26b42cd1376b83c307b1cca3c55e3c23f6281cc51f2445d8536638ba803a3b403490ddfdc5e1993139c5c14671c3b8ac3d087ba0d7bf2e141f47838
  • Loading branch information
apoelstra committed Apr 14, 2024
2 parents 52080a0 + 410fd89 commit 4d9449e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ impl<T: AsRef<[u8]>> Read for Cursor<T> {
let start_pos = self.pos.try_into().unwrap_or(inner.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]);
self.pos =
self.pos.saturating_add(read.try_into().unwrap_or(u64::MAX /* unreachable */));
self.pos = self.pos.saturating_add(read.try_into().unwrap_or(u64::MAX /* unreachable */));
Ok(read)
}
}
Expand Down

0 comments on commit 4d9449e

Please sign in to comment.