Skip to content

replace all Into implementations with From implementations#926

Merged
not-fl3 merged 1 commit intonot-fl3:masterfrom
cyrgani:into-to-from
Mar 29, 2025
Merged

replace all Into implementations with From implementations#926
not-fl3 merged 1 commit intonot-fl3:masterfrom
cyrgani:into-to-from

Conversation

@cyrgani
Copy link
Copy Markdown
Contributor

@cyrgani cyrgani commented Mar 26, 2025

This allows more ergonomic conversions between colors, f32 arrays and u8 arrays, such as:

Color::from([16, 25, 116, 34]);

The Into implementations will be provided automatically, so all existing code continues to work.

The diff can also be reproduced with cargo clippy --fix --lib -p macroquad.

@not-fl3
Copy link
Copy Markdown
Owner

not-fl3 commented Mar 29, 2025

Thanks!

@not-fl3 not-fl3 merged commit 0d24557 into not-fl3:master Mar 29, 2025
6 checks passed
@cyrgani cyrgani deleted the into-to-from branch March 29, 2025 07:59
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