1 2 3 4 5 6 7 8 9 10 11
use ruby_sys::fixnum; use types::{SignedValue, Value}; pub fn int_to_num(num: i64) -> Value { unsafe { fixnum::rb_int2inum(num as SignedValue) } } pub fn num_to_int(num: Value) -> i64 { unsafe { fixnum::rb_num2int(num) as i64 } }