File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -94,15 +94,14 @@ fn bench_rustpy_nbody(b: &mut test::Bencher) {
94
94
95
95
let vm = VirtualMachine :: default ( ) ;
96
96
97
- let code = match vm. compile ( source, compile:: Mode :: Single , "<stdin>" . to_owned ( ) ) {
98
- Ok ( code) => code,
99
- Err ( e) => panic ! ( "{:?}" , e) ,
100
- } ;
97
+ let code = vm
98
+ . compile ( source, compile:: Mode :: Exec , "<stdin>" . to_owned ( ) )
99
+ . unwrap ( ) ;
101
100
102
101
b. iter ( || {
103
102
let scope = vm. new_scope_with_builtins ( ) ;
104
103
let res: PyResult = vm. run_code_obj ( code. clone ( ) , scope) ;
105
- assert ! ( res . is_ok ( ) ) ;
104
+ vm . unwrap_pyresult ( res ) ;
106
105
} )
107
106
}
108
107
@@ -113,14 +112,13 @@ fn bench_rustpy_mandelbrot(b: &mut test::Bencher) {
113
112
114
113
let vm = VirtualMachine :: default ( ) ;
115
114
116
- let code = match vm. compile ( source, compile:: Mode :: Single , "<stdin>" . to_owned ( ) ) {
117
- Ok ( code) => code,
118
- Err ( e) => panic ! ( "{:?}" , e) ,
119
- } ;
115
+ let code = vm
116
+ . compile ( source, compile:: Mode :: Exec , "<stdin>" . to_owned ( ) )
117
+ . unwrap ( ) ;
120
118
121
119
b. iter ( || {
122
120
let scope = vm. new_scope_with_builtins ( ) ;
123
121
let res: PyResult = vm. run_code_obj ( code. clone ( ) , scope) ;
124
- assert ! ( res . is_ok ( ) ) ;
122
+ vm . unwrap_pyresult ( res ) ;
125
123
} )
126
124
}
You can’t perform that action at this time.
0 commit comments