mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 16:44:06 +02:00
unbreak int and float
This commit is contained in:
parent
5bd8313a51
commit
60563afc7a
1 changed files with 2 additions and 2 deletions
|
|
@ -361,7 +361,7 @@ where
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if position + USIZE_BIT_SIZE > self.bit_len() {
|
if position + count + USIZE_BIT_SIZE > self.bit_len() {
|
||||||
if position + count > self.bit_len() {
|
if position + count > self.bit_len() {
|
||||||
return if position > self.bit_len() {
|
return if position > self.bit_len() {
|
||||||
Err(BitError::IndexOutOfBounds {
|
Err(BitError::IndexOutOfBounds {
|
||||||
|
|
@ -711,7 +711,7 @@ where
|
||||||
T: Float + UncheckedPrimitiveFloat,
|
T: Float + UncheckedPrimitiveFloat,
|
||||||
{
|
{
|
||||||
let type_bit_size = size_of::<T>() * 8;
|
let type_bit_size = size_of::<T>() * 8;
|
||||||
if position + USIZE_BIT_SIZE > self.bit_len() {
|
if position + type_bit_size + USIZE_BIT_SIZE > self.bit_len() {
|
||||||
if position + type_bit_size > self.bit_len() {
|
if position + type_bit_size > self.bit_len() {
|
||||||
if position > self.bit_len() {
|
if position > self.bit_len() {
|
||||||
return Err(BitError::IndexOutOfBounds {
|
return Err(BitError::IndexOutOfBounds {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue