Merge rust-bitcoin/rust-bitcoin#2683: Automated nightly rustfmt (2024-04-14)
410fd892e9
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: ACK410fd892e9
one line, nice Tree-SHA512: dadf7c46f26b42cd1376b83c307b1cca3c55e3c23f6281cc51f2445d8536638ba803a3b403490ddfdc5e1993139c5c14671c3b8ac3d087ba0d7bf2e141f47838
This commit is contained in:
commit
4d9449e0f9
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue