-
Notifications
You must be signed in to change notification settings - Fork 194
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
[glsl-in] Implement swizzle for r-values #213
Conversation
Removed unneccessary Otion in return type
src/front/glsl/variables.rs
Outdated
meta: TokenMetadata, | ||
) -> Result<Handle<Expression>, ErrorKind> { | ||
let type_inner = self.resolve_type(expression)?; | ||
match type_inner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's match on the value always, i.e. match *self.resolve_type(expression)? {..}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, except borrow checker wouldn't let me deref with *
(something about unable to move out of shared ref), so had to settle for match self.resolve_type(expression)? {..}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole point of borrowing by value is that it lets you see which things are borrowed, and which not.
So, you see that the borrow checker complains about members
field being moved out? Mark it as ref members
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, maybe one day I will learn to actually listen to what the borrow checker tells me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Related to #210