diff --git a/src/packages/bit_field.rs b/src/packages/bit_field.rs index 6d6ae617..9b0e8bd9 100644 --- a/src/packages/bit_field.rs +++ b/src/packages/bit_field.rs @@ -24,7 +24,7 @@ mod bit_field_functions { #[rhai_fn(return_raw)] pub fn get_bit(value: INT, bit: INT) -> RhaiResultOf { let bit = calc_index(BITS, bit, true, || { - ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE) + ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE).into() })?; Ok((value & (1 << bit)) != 0) @@ -32,7 +32,7 @@ mod bit_field_functions { #[rhai_fn(return_raw)] pub fn set_bit(value: &mut INT, bit: INT, new_value: bool) -> RhaiResultOf<()> { let bit = calc_index(BITS, bit, true, || { - ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE) + ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE).into() })?; let mask = 1 << bit; @@ -63,7 +63,7 @@ mod bit_field_functions { } let bit = calc_index(BITS, bit, true, || { - ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE) + ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE).into() })?; let bits = if bit + bits as usize > BITS { @@ -108,7 +108,7 @@ mod bit_field_functions { } let bit = calc_index(BITS, bit, true, || { - ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE) + ERR::ErrorBitFieldBounds(BITS, bit, Position::NONE).into() })?; let bits = if bit + bits as usize > BITS { diff --git a/src/packages/iter_basic.rs b/src/packages/iter_basic.rs index aae50762..d06931f9 100644 --- a/src/packages/iter_basic.rs +++ b/src/packages/iter_basic.rs @@ -122,7 +122,7 @@ const BITS: usize = std::mem::size_of::() * 8; impl BitRange { pub fn new(value: INT, from: INT, len: INT) -> RhaiResultOf { let from = calc_index(BITS, from, true, || { - crate::ERR::ErrorBitFieldBounds(BITS, from, Position::NONE) + crate::ERR::ErrorBitFieldBounds(BITS, from, Position::NONE).into() })?; let len = if len < 0 {