Skip to content

Commit 5866839

Browse files
authored
use checked addition with range (#438)
1 parent e0d8413 commit 5866839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bytes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl Bytes {
237237
};
238238

239239
let end = match range.end_bound() {
240-
Bound::Included(&n) => n + 1,
240+
Bound::Included(&n) => n.checked_add(1).expect("out of range"),
241241
Bound::Excluded(&n) => n,
242242
Bound::Unbounded => len,
243243
};

0 commit comments

Comments
 (0)