File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Bug fixes
88---------
99
1010* 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 ` .
1112
1213Deprecated API's
1314----------------
Original file line number Diff line number Diff line change @@ -438,15 +438,21 @@ fn main() {
438438 continue ;
439439 }
440440 #[ 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" ) ) ]
447441 "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+ }
450456 continue ;
451457 }
452458 "scope" => {
You can’t perform that action at this time.
0 commit comments