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

Use built-in constant instead of a magic number #18

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

antifuchs
Copy link
Contributor

In job-security providing functions, it is critically important that they be fully in line with best coding practices. Hence, instead of using a well-known(ish!) hardcoded power of two, use u8::MAX to truncate the u32 into a u8.

In job-security providing functions, it is critically important that
they be fully in line with best coding practices. Hence, instead of
using a well-known(ish!) hardcoded power of two, use u8::MAX to
truncate the u32 into a u8.
Copy link
Owner

@Speykious Speykious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea :)
Just a slight nitpick

src/lib.rs Outdated Show resolved Hide resolved
Copy link
Owner

@Speykious Speykious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Speykious Speykious merged commit 3d364e7 into Speykious:main Feb 23, 2024
12 checks passed
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.

2 participants