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

fix: Incorrect macro usage and redundant boolean comparison #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Anon-im
Copy link

@Anon-im Anon-im commented Dec 26, 2024

In Rust, assert! is a macro and must be called with an exclamation mark and a condition inside the parentheses. Using assert(condition) without the exclamation mark will result in a compilation error, as assert does not exist as a function. Without fixing this, the program will not compile.

Redundant == true Check: The function valid_fn already returns a boolean value (bool). When a function already returns a boolean value (bool), an additional comparison with true or false is redundant and reduces code readability.

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.

1 participant