Closed dj8yfo closed 11 months ago
I do have draft commits for those changes so can send PRs soonish for that.
There’s actually more naming changes that I’ve been wondering about though they are a bit philosophical, i.e. it depends what the purpose of borsh schema is. Is it supposed to represent how the Rust type looks or just describe the binary format. The name changes I have in mind are:
Vec<T>
→ [T]
str
, String
→ [u8]
nonzero_xx
→ xx
,HashSet<T>
, BTreeSet<T>
→ [T]
andHashMap<K, V>
, BTreeMap<K, V>
→ [(K, V)]
.And this all leads to further questions about keeping field names when describing structs and variant names when describing enums.
The logic for renaming Tuple<...>
and Array<...>
is to be distinct from what would be derived for a generic struct named Tuple
or Array
taking following subtasks for resolution in scope of one pr
"nil"
-> "()"
string
-> String
nonzero_i8
-> NonZeroI8
...taking following subtask for resolution in scope of one pr:
"Tuple<T0, T1, T2>"
-> "(T0, T1, T2)"
taking following subtask for resolution in scope of one pr:
"Array<T0, N>"
-> "[T0; N]"
"nil"
->"()"
"Tuple<T0, T1, T2>"
->"(T0, T1, T2)"
string
->String
"Array<T0, N>"
->"[T0; N]"
nonzero_i8
->NonZeroI8
...