Skip to content

Conversation

jjbayer
Copy link
Collaborator

@jjbayer jjbayer commented Mar 24, 2024

Replace associated constant for solver names with a method to make Solver object safe.

A trait is object safe if it has the following qualities (defined in RFC 255):

  • [...]
  • It must not have any associated constants.

https://doc.rust-lang.org/beta/reference/items/traits.html#object-safety

@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2024

Codecov Report

Attention: Patch coverage is 7.95455% with 81 lines in your changes are missing coverage. Please review.

Project coverage is 92.11%. Comparing base (73c52ce) to head (d526949).

Files Patch % Lines
crates/argmin/src/core/test_utils.rs 0.00% 3 Missing ⚠️
crates/argmin/src/solver/brent/brentopt.rs 0.00% 3 Missing ⚠️
crates/argmin/src/solver/brent/brentroot.rs 0.00% 3 Missing ⚠️
crates/argmin/src/solver/conjugategradient/cg.rs 0.00% 3 Missing ⚠️
...rgmin/src/solver/conjugategradient/nonlinear_cg.rs 0.00% 3 Missing ⚠️
...n/src/solver/gaussnewton/gaussnewton_linesearch.rs 0.00% 3 Missing ⚠️
...rgmin/src/solver/gaussnewton/gaussnewton_method.rs 0.00% 3 Missing ⚠️
...rates/argmin/src/solver/goldensectionsearch/mod.rs 0.00% 3 Missing ⚠️
crates/argmin/src/solver/landweber/mod.rs 0.00% 3 Missing ⚠️
...rates/argmin/src/solver/linesearch/backtracking.rs 0.00% 3 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
- Coverage   92.42%   92.11%   -0.31%     
==========================================
  Files         178      178              
  Lines       24314    24398      +84     
==========================================
+ Hits        22471    22475       +4     
- Misses       1843     1923      +80     

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

@jjbayer jjbayer changed the title Solver::NAME -> Solver::name() Make Solver object safe Mar 24, 2024
@jjbayer
Copy link
Collaborator Author

jjbayer commented Mar 24, 2024

Requires #488 to pass CI.

@jjbayer jjbayer marked this pull request as ready for review March 24, 2024 14:32
@jjbayer jjbayer requested a review from stefan-k March 24, 2024 21:16
Copy link
Member

@stefan-k stefan-k left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

@stefan-k stefan-k merged commit d5e1f3c into argmin-rs:main Mar 26, 2024
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