Skip to content

Panic when dividing Decimal on usize without explicit casting

Version of tarantool-module: 4.0.0.

Trying to execute sbroad test of view

#[test]
fn test_panic() {
    let will_fail = Decimal::from(1) / 1usize;
}

we get a panic with error already borrowed: BorrowMutError.

In case we explicitly cover usize with Decimal everything will be ok.

let wont_fail = Decimal::from(1) / Decimal::from(1usize);