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

feat: use BTreeMap for deterministic serialization #228

Merged
merged 2 commits into from May 2, 2023

Conversation

SteveLauC
Copy link
Contributor

What does this PR do

  1. Replace HashMap with BTreeMap in struct Package for deterministic serialization
  2. HashMap used in struct MetaCommand is also replaced with BTreeMap

    This won't affect serialization as this type is not #[derive(Serialize)]

  3. Remove two extra std:: prefix in std::fmt as it is already imported

Issue

Closes #224

@oli-obk
Copy link
Owner

oli-obk commented May 2, 2023

I think we should use this opportunity and add clippy to our CI and then deny hash maps via https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_types

Would you like to tackle this as well? If not, that's ok, we can land the PR as is.

@SteveLauC
Copy link
Contributor Author

Would you like to tackle this as well? If not, that's ok, we can land the PR as is.

Happy to include that in this PR, will do it later (tonight or tomorrow) :)

clippy.toml Show resolved Hide resolved
@oli-obk oli-obk merged commit b06d6ba into oli-obk:main May 2, 2023
6 checks passed
@oli-obk
Copy link
Owner

oli-obk commented May 2, 2023

Thanks! I'll see if there are any other breaking changes that I'll want to integrate in the next release, so this may take a bit to get released as we develop the next version.

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

Successfully merging this pull request may close these issues.

Replace all HashMaps with BTreeMaps for determinism
2 participants