Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename declarations (tuples, nil, string, nonzero_xx and arrays) #231

Closed
5 tasks done
dj8yfo opened this issue Sep 23, 2023 · 5 comments
Closed
5 tasks done

Rename declarations (tuples, nil, string, nonzero_xx and arrays) #231

dj8yfo opened this issue Sep 23, 2023 · 5 comments

Comments

@dj8yfo
Copy link
Collaborator

dj8yfo commented Sep 23, 2023

  • "nil" -> "()"
  • "Tuple<T0, T1, T2>" -> "(T0, T1, T2)"
  • string -> String
  • "Array<T0, N>" -> "[T0; N]"
  • nonzero_i8 -> NonZeroI8 ...
@mina86
Copy link
Contributor

mina86 commented Sep 23, 2023

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_xxxx,
  • HashSet<T>, BTreeSet<T>[T] and
  • HashMap<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.

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 25, 2023

The logic for renaming Tuple<...> and Array<...> is to be distinct from what would be derived for a generic struct named Tuple or Array

@dj8yfo dj8yfo changed the title Rename declarations (tuples, nil and arrays) Rename declarations (tuples, nil, string and arrays) Sep 25, 2023
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 26, 2023

taking following subtasks for resolution in scope of one pr

  • "nil" -> "()"
  • string -> String
  • nonzero_i8 -> NonZeroI8 ...

@dj8yfo dj8yfo changed the title Rename declarations (tuples, nil, string and arrays) Rename declarations (tuples, nil, string, nonzero_xx and arrays) Sep 26, 2023
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 26, 2023

taking following subtask for resolution in scope of one pr:

  • "Tuple<T0, T1, T2>" -> "(T0, T1, T2)"

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 26, 2023

taking following subtask for resolution in scope of one pr:

  • "Array<T0, N>" -> "[T0; N]"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants