Skip to content

Commit 5d5c524

Browse files
committed
Make JType conversion to char fatal
1 parent 24387b8 commit 5d5c524

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tyrga-lib/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ fn make_arithmetic_call(
408408
use std::convert::TryInto;
409409
use ArithmeticOperation::*;
410410

411-
let ch : char = kind.try_into()?;
411+
let ch : char = kind.try_into().expect("invalid char kind");
412412

413413
let nargs = {
414414
match op {
@@ -874,7 +874,7 @@ fn make_compare(
874874
) -> GeneralResult<Vec<Instruction>> {
875875
use std::convert::TryInto;
876876

877-
let ch : char = kind.try_into()?;
877+
let ch : char = kind.try_into().expect("invalid char kind");
878878

879879
let (gc, mut v) = sm.reserve_one();
880880
let n = match nans {
@@ -934,8 +934,8 @@ fn make_conversion(
934934
Ok(insns)
935935
},
936936
_ => {
937-
let ch_from : char = from.try_into()?;
938-
let ch_to : char = to .try_into()?;
937+
let ch_from : char = from.try_into().expect("invalid char kind");
938+
let ch_to : char = to .try_into().expect("invalid char kind");
939939
let name = format!("into_{}", ch_to); // TODO improve naming
940940
let desc = format!("({}){}", ch_from, ch_to);
941941
Ok(make_call(sm, &make_builtin_name(&name, &desc), &desc)?)

0 commit comments

Comments
 (0)