xmlgen fails to generate rust code for Suse Snapper
I am trying to generate Rust code for Suse's snapper tool:
> busctl --xml-interface introspect org.opensuse.Snapper /org/opensuse/Snapper > snapper.xml
> zbus-xmlgen snapper.xml
Getting many errors like:
error: expected one of `:` or `@`, found `-`
--> <stdin>:26:42
|
26 | fn calculate_used_space(&self, config-name: &str) -> zbus::Result<()>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:29:39
|
29 | fn create_comparison(&self, config-name: &str, number1: u32, number2: u32) -> zbus::Result<u32>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:32:35
|
32 | fn create_config(&self, config-name: &str, subvolume: &str, fstype: &str, template-name: &str) -> zbus::Result<()>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:32:87
|
32 | fn create_config(&self, config-name: &str, subvolume: &str, fstype: &str, template-name: &str) -> zbus::Result<()>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:35:42
|
35 | fn create_post_snapshot(&self, config-name: &str, pre-number: u32, description: &str, cleanup: &str, userdata: std::collections::HashMap<&str, &str>) -> zbus::Result<u32>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:35:58
|
35 | fn create_post_snapshot(&self, config-name: &str, pre-number: u32, description: &str, cleanup: &str, userdata: std::collections::HashMap<&str, &str>) -> zbus::Result<u32>;
| ^ expected one of `:` or `@`
error: expected one of `:` or `@`, found `-`
--> <stdin>:38:41
|
38 | fn create_pre_snapshot(&self, config-name: &str, description: &str, cleanup: &str, userdata: std::collections::HashMap<&str, &str>) -> zbus::Result<u32>;
| ^ expected one of `:` or `@`
<the rest are omitted but very similar>
Please note, this happens even when i try to use the xml generated by zbus-xmlgen
.
To reproduce the issue all you need is to have snapper installed through any package manager.
Please help me, i can give any further help if needed.
Edited by Marcell Legeza