Skip to content

Apply const keyword to various methods#167

Merged
poljar merged 2 commits intomatrix-org:mainfrom
MTRNord:MTRNord/const
Aug 8, 2024
Merged

Apply const keyword to various methods#167
poljar merged 2 commits intomatrix-org:mainfrom
MTRNord:MTRNord/const

Conversation

@MTRNord
Copy link
Copy Markdown
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 [email protected]

… 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
Copy Markdown

codecov-commenter commented Aug 6, 2024

Codecov Report

❌ 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 170 commits behind head on main.

Files with missing lines 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
Copy Markdown
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 :))

@poljar poljar enabled auto-merge (squash) August 8, 2024 10:59
Copy link
Copy Markdown
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
@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