Implemented num_order methods on Integer & Rational numbers

This commit is contained in:
Fayeed Pawaskar
2023-09-04 14:12:47 +05:30
parent cfd67c8337
commit 7b921fc767
10 changed files with 240 additions and 131 deletions

View File

@@ -1116,8 +1116,9 @@ pub(crate) fn constant_key_alternatives(
}
*/
Literal::Integer(ref n) => {
if let Some(n) = n.to_isize() {
Fixnum::build_with_checked(n as i64).map(|n| {
let result = n.value().try_into();
if let Ok(value) = result {
Fixnum::build_with_checked(value).map(|n| {
constants.push(Literal::Fixnum(n));
}).unwrap();
}