diff --git a/zbus_xmlgen/src/lib.rs b/zbus_xmlgen/src/lib.rs index 025a8d252..5d21ac54b 100644 --- a/zbus_xmlgen/src/lib.rs +++ b/zbus_xmlgen/src/lib.rs @@ -241,7 +241,7 @@ fn to_rust_type(ty: &CompleteType, input: bool, as_ref: bool) -> String { } else if vec.len() > 1 { format!("{}({})", if as_ref { "&" } else { "" }, vec.join(", ")) } else { - vec[0].to_string() + format!("{}({},)", if as_ref { "&" } else { "" }, vec[0]) } } _ => unimplemented!(), diff --git a/zbus_xmlgen/tests/data/sample_object0.rs b/zbus_xmlgen/tests/data/sample_object0.rs index 03b357f88..6b13a2c58 100644 --- a/zbus_xmlgen/tests/data/sample_object0.rs +++ b/zbus_xmlgen/tests/data/sample_object0.rs @@ -4,6 +4,9 @@ trait SampleInterface0 { /// BarplexSig method fn barplex_sig(&self, rule: &(&[i32], i32, std::collections::HashMap<&str, &str>, i32, &[i32], i32, &[&str], i32, bool)) -> zbus::Result>; + /// Bazic method + fn bazic(&self, bar: &(i32, i32), foo: &(i32,)) -> zbus::Result<((i32, i32), Vec<(i32,)>)>; + /// Bazify method fn bazify(&self, bar: &(i32, i32, u32)) -> zbus::Result; diff --git a/zbus_xmlgen/tests/data/sample_object0.xml b/zbus_xmlgen/tests/data/sample_object0.xml index 6f2e4dcf6..cffa98fc3 100644 --- a/zbus_xmlgen/tests/data/sample_object0.xml +++ b/zbus_xmlgen/tests/data/sample_object0.xml @@ -9,6 +9,12 @@ + + + + + +