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

Apply const keyword to various methods #167

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

MTRNord
Copy link
Contributor

@MTRNord MTRNord commented Aug 2, 2024

This is based on the feedback given by the clippy missing_const_for_fn lint, which is still in nursery.

In a very non-scientific comparison, the olm-message-decoding afl fuzzer runs with ~0.5k to ~1k more executions per second on my PC.

I did not verify if any bindings rely on these to be not const. However, the test suite returned that everything is ok.

Signed-Off-By: MTRNord git@nordgedanken.dev

… clippy check

Also enables `clippy::missing_const_for_fn` as a warning
@MTRNord MTRNord requested review from dkasak and poljar as code owners August 2, 2024 17:30
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 95.31250% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.55%. Comparing base (4906baf) to head (c890027).
Report is 1 commits behind head on main.

Files Patch % Lines
src/ecies/mod.rs 80.00% 1 Missing ⚠️
src/olm/messages/message.rs 75.00% 1 Missing ⚠️
src/olm/messages/pre_key.rs 83.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #167   +/-   ##
=======================================
  Coverage   90.55%   90.55%           
=======================================
  Files          34       34           
  Lines        1905     1906    +1     
=======================================
+ Hits         1725     1726    +1     
  Misses        180      180           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MTRNord
Copy link
Contributor Author

MTRNord commented Aug 6, 2024

(just commeting to ack that I have seen the clippy ci failing. Deal Ing with that when at my pc :))

Signed-off-by: MTRNord <mtrnord1@gmail.com>
@poljar poljar enabled auto-merge (squash) August 8, 2024 10:59
Copy link
Collaborator

@poljar poljar left a comment

Choose a reason for hiding this comment

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

Not sure how terribly useful this is but it shouldn't hurt.

@poljar poljar merged commit 72f4235 into matrix-org:main Aug 8, 2024
18 checks passed
@MTRNord MTRNord deleted the MTRNord/const branch August 8, 2024 12: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.

3 participants