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

Make hue ::from_degrees and some palette::cast::* functions const fn #405

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

Ogeon
Copy link
Owner

@Ogeon Ogeon commented Jul 31, 2024

This makes the following functions const fn, as allowed by Rust 1.61.0:

  • ::from_degrees for hue types
  • palette::cast::into_array_ref
  • palette::cast::from_array_ref
  • palette::cast::into_uint_ref
  • palette::cast::from_uint_ref

Copy link

codspeed-hq bot commented Jul 31, 2024

CodSpeed Performance Report

Merging #405 will degrade performances by 11.73%

Comparing const_fn (13368ac) with master (afa3b12)

Summary

❌ 1 regressions
✅ 45 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master const_fn Change
matrix_inverse 438.9 ns 497.2 ns -11.73%

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.66%. Comparing base (afa3b12) to head (13368ac).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
- Coverage   82.66%   82.66%   -0.01%     
==========================================
  Files         127      127              
  Lines       19545    19539       -6     
  Branches    19545    19539       -6     
==========================================
- Hits        16157    16151       -6     
  Misses       3285     3285              
  Partials      103      103              
Components Coverage Δ
palette 82.71% <100.00%> (-0.01%) ⬇️
palette_derive 81.98% <ø> (ø)

@Ogeon Ogeon merged commit 7971660 into master Jul 31, 2024
17 of 20 checks passed
@Ogeon Ogeon deleted the const_fn branch July 31, 2024 11:30
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