File tree Expand file tree Collapse file tree
crates/transpiler/src/target Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1517,9 +1517,13 @@ impl Target {
15171517 bounds : & [ Option < [ f64 ; 2 ] > ] ,
15181518 ) -> Result < ( ) , TargetError > {
15191519 let num_bounds = bounds. len ( ) ;
1520- let operation = self . operation_from_name ( name) ;
1520+ let Some ( operation) = self . operation_from_name ( name) else {
1521+ return Err ( TargetError :: InvalidKey ( format ! (
1522+ "{name} is not an instruction in the target."
1523+ ) ) ) ;
1524+ } ;
15211525 let num_params = match operation {
1522- Some ( TargetOperation :: Normal ( op) ) => {
1526+ TargetOperation :: Normal ( op) => {
15231527 let params = op. params_view ( ) ;
15241528 if params
15251529 . iter ( )
@@ -1532,11 +1536,7 @@ impl Target {
15321536 }
15331537 params. len ( )
15341538 }
1535- _ => {
1536- return Err ( TargetError :: InvalidKey ( format ! (
1537- "{name} is not an instruction in the target."
1538- ) ) ) ;
1539- }
1539+ TargetOperation :: Variadic ( _) => 0 ,
15401540 } ;
15411541 if num_bounds != num_params {
15421542 return Err ( TargetError :: InvalidKey ( format ! (
You can’t perform that action at this time.
0 commit comments