Support mutable method arguments with dbus_interface macro
Currently it's possible to directly declare a method argument as mutable when using the dbus_proxy
macro, but when using dbus_interface
it gives an error, that disappears when dropping the dbus_interface
macro:
error: expected expression, found keyword `mut`
--> src/example.rs:189:23
|
189 | async fn t(&self, mut s: String) -> fdo::Result<()> {
| ^^^ expected expression
error: expected expression
--> src/example.rs:189:23
|
189 | async fn t(&self, mut s: String) -> fdo::Result<()> {
with example code
struct Test;
#[dbus_interface(name = "org.example.Test")]
impl Test {
async fn t(&self, mut s: String) -> fdo::Result<()> {
s.push_str("foo");
Ok(())
}
}
Of course in this case it's possible to clone and shadow the argument, but it's less convenient and wastes memory (in the case where borrowed arguments are used).