-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 zbus_xmlgen: Fix structs with a single element
When the xml element had a struct containing only a single type, the parser was returning the element itself. This was wrong since a D-Bus struct is expected to be translated into a tuple, regardless of how many types it has (except for 0 elements, which is not accepted according to D-Bus spec). Returning a single-element tuple type instead. Note: As defined on Rust syntax, the single-element tuple type has a trailing comma inside parenthesis, not to be confused with compiler lint "unused_parens". Examples: (i32,) --> OK. Single-element tuple with i32 element. (i32) --> ERROR. Wrong use of parenthesis that clutters readability. Co-authored-by: Vitor Nagata <[email protected]>
- Loading branch information
Showing
3 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters