8000 Fix `clippy::cast_lossless` by tomcur · Pull Request #985 · linebender/vello · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix clippy::cast_lossless #985

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 1 commit into from
May 8, 2025
Merged

Fix clippy::cast_lossless #985

merged 1 commit into from
May 8, 2025

Conversation

tomcur
Copy link
Member
@tomcur tomcur commented May 8, 2025

This makes it clear that these are lossless conversions.

@LaurenzV
Copy link
Contributor
LaurenzV commented May 8, 2025

I'm not a 100% sold on this as I think it makes the code much more verbos, but if others think it's good to have then I'm fine with it.

@DJMcNab
Copy link
Member
DJMcNab commented May 8, 2025

I lead towards being in favour here. I wish as had better behaviour, but the unfortunate fact is that it's generally best practise to avoid as as often as possible.

Copy link
Member Author
@tomcur tomcur left a comment

Choose a reason for hiding this comment

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

as when From is implemented will also be lossless, but using From makes that fact absolutely clear. Every as causes some overhead when reading as it needs to be scrutinized. I agree it is unfortunate.

@tomcur tomcur force-pushed the push-mzwyzrrqkyxy branch from cdc7164 to 5ea9632 Compare May 8, 2025 20:19
@tomcur tomcur enabled auto-merge May 8, 2025 20:22
@tomcur tomcur added this pull request to the merge queue May 8, 2025
Merged via the queue into main with commit fd3011b May 8, 2025
17 checks passed
@tomcur tomcur deleted the push-mzwyzrrqkyxy branch May 8, 2025 20:28
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
0