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

Make Vec3A::from_vec4 const #545

Closed
herabit opened this issue Aug 5, 2024 · 3 comments
Closed

Make Vec3A::from_vec4 const #545

herabit opened this issue Aug 5, 2024 · 3 comments
Labels
1.0 Issues to be fixed before 1.0 stable release

Comments

@herabit
Copy link

herabit commented Aug 5, 2024

All of the implementations of Vec3A::from_vec4 do not seem to require non-const functionality, so marking them all as const fn will increase their versatility for API consumers.

I would make a pull request if I was more familiar with contributing to open source, as this seems like a minor change, though yeah I'd need to look into how to, do that.

@herabit
Copy link
Author

herabit commented Aug 5, 2024

Wish I had read the contributing guide, I'll make this into a discussion. I'll leave this open for now just in case this is the preferred channel for communication. Close this if it you desire as, yeah I will create the discussion.

@bitshifter
Copy link
Owner

If it's any consolation almost no one reads the contributing guide :) I really need to make an issue template directing people to discussions. I replied to your discussion thread but I'll leave this open until the PR is merged.

@bitshifter bitshifter added the 1.0 Issues to be fixed before 1.0 stable release label Aug 12, 2024
@bitshifter
Copy link
Owner

It turns out this is not currently possible because Vec3::from_vec4 invokes deref to access the x,y & z values which can't be done in a const context.

At some point this might be possible rust-lang/rust#67792.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0 Issues to be fixed before 1.0 stable release
Projects
None yet
Development

No branches or pull requests

2 participants