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 clippy lint in programs/sbf #4503

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

LucasSte
Copy link

@LucasSte LucasSte commented Jan 16, 2025

Problem

Cargo clippy nightly 2024-11-22 requires that large constant arrays be declared as static.

Summary of Changes

I followed clippy's suggestion to make the array static. In the test, we only use its zeroed values to ensure the stack and heap are initialized as zero in an assert_eq! macro.

According to clippy's documentation, const arrays are inlined, while static are initialized in a fixed memory location to which every usage refers. As we are only using it for a comparison, either constant or static should do the job.

@LucasSte LucasSte requested review from brooksprumo and yihau January 16, 2025 19:21
@LucasSte LucasSte marked this pull request as ready for review January 16, 2025 19:21
@LucasSte LucasSte merged commit 9ec0980 into anza-xyz:master Jan 16, 2025
47 checks passed
@LucasSte LucasSte deleted the fix-clippy branch January 16, 2025 22:38
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