Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I acknowledge that:
cargo test
;cargo fmt
;using
cargo doc
;where appropriate; and
dev
branch.What is the current problem, or feature that should be added?
What aspect of the project needs changing?
The code itself was hard to maintain as there were a lot of match statements, that were not really exhaustive, and lead to a spaghetti of functions. There were also a scattering of mistakes that
cargo clippy
suggested to fix.How does this fix and/or better quantr?
If it's a feature, please add examples on how you would use it.
Now, the code makes proper use of the exhaustive nature of match statements, leading to a huge reduction in code for the main simulation. Moreover, loads of panic statements have been removed. This has increased the readability and maintainability of the main simulation algorithm. For instance, if there were to be a new gate added, the compiler would be able to better guide the developer through what new branches in match statements would have to be added.
Is this pull request a major or minor change with respect to the
dev
branch?Please refer to semantic versioning for Rust. If this is a major/breaking change, please add an explanation to why it could not be minor, or equally why it should break the current version.
Minor
What do the unit tests cover?
Description of the unit tests added (if applicable).
Not applicable.
Additional comments.
Any more justifications, examples of output, or even suggestions for improving this pull request template are all welcome!