Skip to content

remove impl ToColor for isize #1473

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

Merged
merged 2 commits into from
Mar 27, 2025

Conversation

antonilol
Copy link
Contributor

  • there is an impl for u32 already, that impl is now the only one so rustc easily figures out the number type, that does not have to be explicitly annotated anymore.
  • isize is not always wide enough to represent all colors. writing 0xff0000ffisize compiles on 64 bit systems but not on 32 or 16 bit systems. (deny-by-default warning, if allowed it will panic at runtime)

- there is an impl for `u32` already, that impl is now the only one so
  rustc easily figures out the number type, that does not have to be
  explicitly annotated anymore.
- `isize` is not always wide enough to represent all colors. writing
  0xff0000ffisize compiles on 64 bit systems but not on 32 or 16 bit
  systems. (deny-by-default warning, if `allow`ed it will panic at
  runtime)
@antonilol antonilol merged commit f0cdbb3 into Rust-SDL2:master Mar 27, 2025
17 checks passed
@antonilol antonilol deleted the remove-isize-tocolor branch March 27, 2025 22:13
@antonilol
Copy link
Contributor Author

Also included the changelog entry for #1470

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