Skip to content

fix rust/44095 (f64::clamp) todos#522

Closed
LetsMelon wants to merge 1 commit intolinebender:masterfrom
LetsMelon:fix_rust_44095_todos
Closed

fix rust/44095 (f64::clamp) todos#522
LetsMelon wants to merge 1 commit intolinebender:masterfrom
LetsMelon:fix_rust_44095_todos

Conversation

@LetsMelon
Copy link

A pull request must contain a meaningful improvement to the project.

This PR only fixes TODO's for the f64::clamp rfc.
f64::clampis in rust since 1.50.0 -> doc.rust-lang.org

@RazrFalcon
Copy link
Collaborator

This is not really a fix. float::clamp from std will panic if min/max is NaN, while our code will not (in release). So there should be a different approach.

Ideally, we should prove that numbers are finite to begin with, but this would require a significant changes to the resvg.

@LetsMelon
Copy link
Author

Oh, I haven't thought about that.
Then maybe replace the TODO's with a comment, why resvg is using a homemade clap function instead of the std.

@RazrFalcon
Copy link
Collaborator

Yes, this is an outdated comment/todo, sorry.

@LetsMelon
Copy link
Author

No problem, but then I'm going to close this PR.

@LetsMelon LetsMelon closed this Jul 10, 2022
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