From 149b747dceb5ad857abb019de107dbe7b0eeb267 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 19 Apr 2025 22:39:10 +0200 Subject: [PATCH] Respect case --- dbus/com.example.mytest.xml | 9 ++++----- src/main.rs | 12 +++++------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dbus/com.example.mytest.xml b/dbus/com.example.mytest.xml index fbad3e3..6a1f726 100644 --- a/dbus/com.example.mytest.xml +++ b/dbus/com.example.mytest.xml @@ -2,15 +2,14 @@ "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> - - + - - + + - + \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 8bc979d..ac3e18b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,17 +21,15 @@ impl Device { } impl mytest::ComExampleMytest for Device { - fn hello(&self, name: &str) -> Result { - Ok(format!("Hello, {}!", name)) + fn say_hello(&self) -> Result { + Ok(format!("Hello, {}!", self.name.borrow())) } - fn name(&self) -> Result { - let name = self.name.borrow(); - - Ok(name.clone()) + fn name(&self) -> Result { + Ok(self.name.borrow().clone()) } - fn setname(&self, value: String) -> Result<(), tree::MethodErr> { + fn set_name(&self,value:String) -> Result<(),tree::MethodErr> { self.name.replace(value); Ok(()) }