-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Refactor Caesar Algorithm Implementation #720
Conversation
…all -- -D warnings`
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #720 +/- ##
=======================================
Coverage 94.85% 94.86%
=======================================
Files 302 302
Lines 22575 22590 +15
=======================================
+ Hits 21414 21429 +15
Misses 1161 1161 ☔ View full report in Codecov by Sentry. |
Dedicated macro_rule for happy path and error cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about defining the 26
as some constant. It could be computed as a difference between a
and z
(plus 1, I think).
Defined the alphabet length as a constant: `b'z' - b'a' + 1`
That's a good idea. I defined it as: const ALPHABET_LENGTH: u8 = b'z' - b'a' + 1; |
Description
Refactored the Caesar algorithm to handle larger inputs and rotations while preserving the existing code structure. Included additional tests for improved coverage.
Type of change
Checklist:
cargo clippy --all -- -D warnings
just before my last commit and fixed any issue that was found.cargo fmt
just before my last commit.cargo test
just before my last commit and all tests passed.mod.rs
file within its own folder, and in any parent folder(s).DIRECTORY.md
with the correct link.COUNTRIBUTING.md
and my code follows its guidelines.