File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
crates/wasmtime/src/runtime/wave Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,16 @@ impl WasmValue for crate::Val {
7070 ) ) ;
7171 }
7272 }
73- let [ l_val, h_val] : [ Self ; 2 ] = vals
74- . into_iter ( )
75- . collect :: < Vec < _ > > ( )
76- . try_into ( )
77- . map_err ( |_| WasmValueError :: Other ( "expected 2 values" . to_string ( ) ) ) ?;
73+ let mut iter = vals. into_iter ( ) ;
74+ let Some ( l_val) = iter. next ( ) else {
75+ return Err ( WasmValueError :: Other ( "expected 2 values" . to_string ( ) ) ) ;
76+ } ;
77+ let Some ( h_val) = iter. next ( ) else {
78+ return Err ( WasmValueError :: Other ( "expected 2 values" . to_string ( ) ) ) ;
79+ } ;
80+ if iter. next ( ) . is_some ( ) {
81+ return Err ( WasmValueError :: Other ( "expected 2 values" . to_string ( ) ) ) ;
82+ }
7883
7984 let ( Some ( l) , Some ( h) ) = ( l_val. i64 ( ) , h_val. i64 ( ) ) else {
8085 return Err ( WasmValueError :: Other ( "expected 2 i64s (v64x2)" . to_string ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments