From 7ea1400843184569c56e25b88fa99320917ccfe1 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 23 Sep 2024 14:31:00 +0800 Subject: [PATCH] fixup cram-console for xous-ipc 0.10 --- services/cram-console/src/repl.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/services/cram-console/src/repl.rs b/services/cram-console/src/repl.rs index ee5015a83..419fdb708 100644 --- a/services/cram-console/src/repl.rs +++ b/services/cram-console/src/repl.rs @@ -127,8 +127,7 @@ impl Repl { if let Some(res) = self.env.dispatch(Some(&mut String::from(&local)), None).expect("command dispatch failed") { - let output_history = - History { text: String::from(res.as_str().unwrap_or("UTF-8 Error")), is_input: false }; + let output_history = History { text: String::from(res.as_str()), is_input: false }; self.circular_push(output_history); } else { dirty = false; @@ -136,8 +135,7 @@ impl Repl { } else if let Some(msg) = &self.msg { log::trace!("processing callback msg: {:?}", msg); if let Some(res) = self.env.dispatch(None, Some(msg)).expect("callback failed") { - let output_history = - History { text: String::from(res.as_str().unwrap_or("UTF-8 Error")), is_input: false }; + let output_history = History { text: String::from(res.as_str()), is_input: false }; self.circular_push(output_history); } else { dirty = false; @@ -164,11 +162,11 @@ impl Repl { self.gam .draw_rectangle( self.content, - Rectangle::new_with_style( - Point::new(0, 0), - self.screensize, - DrawStyle { fill_color: Some(PixelColor::Light), stroke_color: None, stroke_width: 0 }, - ), + Rectangle::new_with_style(Point::new(0, 0), self.screensize, DrawStyle { + fill_color: Some(PixelColor::Light), + stroke_color: None, + stroke_width: 0, + }), ) .expect("can't clear content area"); }