From 9192775e5ead273d0c1f5d04d10db28c4909e479 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Fri, 30 Oct 2020 11:19:17 +0800 Subject: [PATCH] graphics-server: use String for String opcode Signed-off-by: Sean Cross --- services/graphics-server/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/services/graphics-server/src/lib.rs b/services/graphics-server/src/lib.rs index fe1e6b011..82553865b 100644 --- a/services/graphics-server/src/lib.rs +++ b/services/graphics-server/src/lib.rs @@ -2,6 +2,7 @@ pub mod api; pub use api::{Point, Color, Rect}; +use xous::String; use xous::{send_message, CID}; @@ -29,6 +30,6 @@ pub fn clear_region(cid: CID, x0: usize, y0: usize, x1: usize, y1: usize) -> Res send_message(cid, api::Opcode::ClearRegion(Rect::new(x0 as _, y0 as _, x1 as _, y1 as _)).into()).map(|_| ()) } -pub fn draw_string(cid: CID, s: &str) -> Result<(), xous::Error> { - send_message(cid, api::Opcode::String(s).into()).map(|_| ()) +pub fn draw_string(cid: CID, s: &String) -> Result<(), xous::Error> { + s.lend(cid, 1).map(|_| ()) }