From 8786b6db7b7e70616274b57eb108146b27d36b7c Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 4 Apr 2021 02:15:29 +0800 Subject: [PATCH] should be borrowing the name server object to make connections --- RELEASE-v0.8.md | 2 +- services/com/src/lib.rs | 2 +- services/graphics-server/src/lib.rs | 2 +- services/trng/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASE-v0.8.md b/RELEASE-v0.8.md index c0a00c0b7..60f658f07 100644 --- a/RELEASE-v0.8.md +++ b/RELEASE-v0.8.md @@ -138,7 +138,7 @@ pub struct MyServer { callback_sid: Option, // this is only necessary if you have callbacks } impl MyServer { - pub fn new(xns: xous_names::XousNames) -> Result { + pub fn new(xns: &xous_names::XousNames) -> Result { let conn = xns.request_connection_blocking(api::MY_SERVER_NAME).expect("Can't connect to MyServer"); Ok(MyServer { conn, diff --git a/services/com/src/lib.rs b/services/com/src/lib.rs index 4b34de27a..41a2e11a5 100644 --- a/services/com/src/lib.rs +++ b/services/com/src/lib.rs @@ -42,7 +42,7 @@ pub struct Com { battstats_sid: Option, } impl Com { - pub fn new(xns: xous_names::XousNames) -> Result { + pub fn new(xns: &xous_names::XousNames) -> Result { let conn = xns.request_connection_blocking(api::SERVER_NAME_COM).expect("Can't connect to COM server"); Ok(Com { conn, diff --git a/services/graphics-server/src/lib.rs b/services/graphics-server/src/lib.rs index 4e77c8195..0ae56fe6e 100644 --- a/services/graphics-server/src/lib.rs +++ b/services/graphics-server/src/lib.rs @@ -16,7 +16,7 @@ pub struct Gfx { conn: xous::CID, } impl Gfx { - pub fn new(xns: xous_names::XousNames) -> Result { + pub fn new(&xns: xous_names::XousNames) -> Result { let conn = xns.request_connection_blocking(api::SERVER_NAME_GFX).expect("Can't connect to GFX"); Ok(Gfx { conn, diff --git a/services/trng/src/lib.rs b/services/trng/src/lib.rs index 73df169ba..8b7ca26db 100644 --- a/services/trng/src/lib.rs +++ b/services/trng/src/lib.rs @@ -8,7 +8,7 @@ pub struct Trng { conn: CID, } impl Trng { - pub fn new(xns: xous_names::XousNames) -> Result { + pub fn new(&xns: xous_names::XousNames) -> Result { let conn = xns.request_connection_blocking(api::SERVER_NAME_TRNG).expect("Can't connect to TRNG server"); Ok(Trng { conn