Skip to content

Comments

Future-proof casting bool to i32#19

Open
guylamar2006 wants to merge 1 commit intoSupreeeme:mainfrom
guylamar2006:patch-2
Open

Future-proof casting bool to i32#19
guylamar2006 wants to merge 1 commit intoSupreeeme:mainfrom
guylamar2006:patch-2

Conversation

@guylamar2006
Copy link
Contributor

If the type of is_press changes in the future, the as cast may not handle the conversion safely and could introduce silent bugs.

i32::from: Using i32::from ensures that the conversion is handled safely and explicitly, making it more robust against future changes.

If the type of is_press changes in the future, the as cast may not handle the conversion safely and could introduce silent bugs.

i32::from: Using i32::from ensures that the conversion is handled safely and explicitly, making it more robust against future changes.
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.

1 participant