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

Add an INIFNITY constant to Size. #413

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

nils-mathieu
Copy link
Contributor

This pull request adds the INFINITY constant to Size.

const INFINITY: Size = Size::new(f64::INFINITY, f64::INFINITY);

I found myself writing a lot of infinite sizes manually to represent "no constraint", and thought it would be cleaner to have it as an associated constant instead.

Potential questions

Is there any other constants we might want for Size? INFINITY is the only one I personally needed, but maybe there are others.

Copy link
Contributor

@jneem jneem left a comment

Choose a reason for hiding this comment

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

Let's wait on other constants until someone actually wants them.

@waywardmonkeys waywardmonkeys added this pull request to the merge queue Feb 19, 2025
Merged via the queue into linebender:main with commit b487bda Feb 19, 2025
15 checks passed
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