File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -465,7 +465,9 @@ impl Application for CosmicCalculator {
465465 return Task :: batch ( tasks) ;
466466 }
467467
468- let outcome = String :: from_utf8 ( output. stdout ) . unwrap_or_default ( ) ;
468+ let outcome = String :: from_utf8 ( output. stdout )
469+ . unwrap_or_default ( )
470+ . replace ( [ '\n' , '\r' ] , "" ) ;
469471 if outcome. is_empty ( ) {
470472 tracing:: error!( "Failed to parse qalc output" ) ;
471473 tasks. push ( self . update ( Message :: ShowToast (
@@ -474,7 +476,7 @@ impl Application for CosmicCalculator {
474476 return Task :: batch ( tasks) ;
475477 } ;
476478
477- self . calculator . outcome = outcome. to_string ( ) ;
479+ self . calculator . outcome = outcome. clone ( ) ;
478480
479481 let mut history = self . config . history . clone ( ) ;
480482 history. push ( self . calculator . clone ( ) ) ;
@@ -491,7 +493,7 @@ impl Application for CosmicCalculator {
491493 . text ( self . calculator . expression . clone ( ) )
492494 . data ( self . calculator . clone ( ) ) ;
493495
494- self . calculator . expression = outcome. to_string ( ) ;
496+ self . calculator . expression = outcome;
495497 }
496498 Message :: Key ( modifiers, key) => {
497499 for ( key_bind, action) in & self . key_binds {
You can’t perform that action at this time.
0 commit comments