aboutsummaryrefslogtreecommitdiff
path: root/src/bytes.rs
diff options
context:
space:
mode:
authorGravatar Brad Dunbar <dunbarb2@gmail.com> 2024-04-24 05:49:53 -0400
committerGravatar GitHub <noreply@github.com> 2024-04-24 05:49:53 -0400
commit9d3ec1cffb76141b4706bb289beced8b04ecac4a (patch)
tree0a8f3462b82f24e87151a4c77d39d4ece8bf6e08 /src/bytes.rs
parent4e2c9c065a06bf9cb5d7dd46e3b29f62a1c20057 (diff)
downloadbytes-9d3ec1cffb76141b4706bb289beced8b04ecac4a.tar.gz
bytes-9d3ec1cffb76141b4706bb289beced8b04ecac4a.tar.zst
bytes-9d3ec1cffb76141b4706bb289beced8b04ecac4a.zip
Resize refactor (#696)
* use checked_sub * return when additional == 0 * move safe operation out of unsafe block * use spare_capacity_mut instead of chunk_mut We don't need to check capacity because it's already been reserved above. * Add safety comments * refactor to use guard clauses This would be better written with let-else, but we won't get that until `MSRV >= 1.65.x`. * use if-let instead of unwrap * reduce scope of unsafe blocks Co-authored-by: Alice Ryhl <aliceryhl@google.com> --------- Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions