3 ms·
This specific case simply doesn't compile: if num > limit {} ^^^^^ expected i32, found usize The whole trick isn't really translatable to idi
by pornel 7y ago
This specific case simply doesn't compile:
if num > limit {}
^^^^^ expected i32, found usize
The whole trick isn't really translatable to idiomatic Rust, because `malloc` is not used beyond specific C interoperability needs. If you want to store `num` elements, you use `Vec::with_capacity(num)` or such, instead of allocating the hard way.