mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-30 07:29:49 +00:00
Reformat types string for decl_storage (#1298)
* Clean space from types when converting to string * Missing cases. * Add unit test for complex type, complete clean fn.
This commit is contained in:
1 parent
66ad1ed974
commit
9c8e3ffb52
3 files changed
+47
-5
No files matched your search
@@ -92,3 +92,22 @@ pub fn generate_hidden_includes(unique_id: &str, def_crate: &str, crate_id: &str
|
||||
)
|
||||
}.into()
|
||||
}
|
||||
|
||||
// fn to remove white spaces arount string types
|
||||
// (basically whitespaces arount tokens)
|
||||
pub fn clean_type_string(input: &str) -> String {
|
||||
input
|
||||
.replace(" ::", "::")
|
||||
.replace(":: ", "::")
|
||||
.replace(" ,", ",")
|
||||
.replace(" ;", ";")
|
||||
.replace(" [", "[")
|
||||
.replace("[ ", "[")
|
||||
.replace(" ]", "]")
|
||||
.replace(" (", "(")
|
||||
.replace("( ", "(")
|
||||
.replace(" )", ")")
|
||||
.replace(" <", "<")
|
||||
.replace("< ", "<")
|
||||
.replace(" >", ">")
|
||||
}
|
||||
Reference in new issue
Block a user