File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Bug fixes
8
8
---------
9
9
10
10
* The position of an undefined operation call now points to the operator instead of the first operand.
11
+ * The ` optimize ` command in ` rhai-repl ` now works properly and cycles through ` None ` ->` Simple ` ->` Full ` .
11
12
12
13
Deprecated API's
13
14
----------------
Original file line number Diff line number Diff line change @@ -438,15 +438,21 @@ fn main() {
438
438
continue ;
439
439
}
440
440
#[ cfg( not( feature = "no_optimize" ) ) ]
441
- "optimize" if optimize_level == rhai:: OptimizationLevel :: Simple => {
442
- optimize_level = rhai:: OptimizationLevel :: None ;
443
- println ! ( "Script optimization turned OFF." ) ;
444
- continue ;
445
- }
446
- #[ cfg( not( feature = "no_optimize" ) ) ]
447
441
"optimize" => {
448
- optimize_level = rhai:: OptimizationLevel :: Simple ;
449
- println ! ( "Script optimization turned ON." ) ;
442
+ match optimize_level {
443
+ rhai:: OptimizationLevel :: Full => {
444
+ optimize_level = rhai:: OptimizationLevel :: None ;
445
+ println ! ( "Script optimization turned OFF." ) ;
446
+ }
447
+ rhai:: OptimizationLevel :: Simple => {
448
+ optimize_level = rhai:: OptimizationLevel :: Full ;
449
+ println ! ( "Script optimization turned to FULL." ) ;
450
+ }
451
+ _ => {
452
+ optimize_level = rhai:: OptimizationLevel :: Simple ;
453
+ println ! ( "Script optimization turned to SIMPLE." ) ;
454
+ }
455
+ }
450
456
continue ;
451
457
}
452
458
"scope" => {
You can’t perform that action at this time.
0 commit comments