-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Added macro to create functions in PipelineNamespace #26606
Added macro to create functions in PipelineNamespace #26606
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. |
r? @gterzian |
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, looks likes a great start!
Would it be possible to additional functionality to the macro, maybe via a separate one, that would generate the various Id
types, something like namespaced_id!(PipelineId)
(which would then also generate the matching PipelineIndex
)?
Perhaps this could be done with the same macro, but I am not sure, in that case it could be for example create_pipeline_namespace! {PipelineId, self}
that would do what the current macro does, plus would also generate the PipelineId
and PipelineIndex
types.
Hey! I believe rust does not allow modification to variable names (like suffix and prefix). I was wondering if we could pass We can definitely generate the Id and Index inside the macros. I am thinking of having two macros, one defined in the PR, and another one Also I believe two macros would need to be called separately. Please correct if I'm wrong. Let me know if this sounds good. |
Ok, so you mean we'd have to pass
Sounds good.
I'm not sure, let me know what you find out! |
Hey, I have added the macro. Let me know if this looks good. |
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.
Looks great! Just one question.
components/msg/constellation_msg.rs
Outdated
index: BlobIndex(self.next_index()), | ||
} | ||
} | ||
create_pipeline_namespace_function! {next_pipeline_id, PipelineId, self, PipelineIndex} |
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.
nit: how about we name it a bit shorter, like namespace_id_method
?
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.
renamed it
Hey, updated the name. Let me know if anything else is needed. |
Great! If you can please squash the third commit into the first, then it should be good to go! |
9c34b32
to
16c3b89
Compare
Squashed them into one. |
Awesome, thanks! @bors-servo r+ |
📌 Commit 16c3b89 has been approved by |
☀️ Test successful - status-taskcluster |
@gterzian Can you please suggest another issue that I can take up? |
I'd like to work on #26571 as I'm hoping there will be more learning. Could you please assign that to me? And please tell on what to read up for the same? |
Changes to constellation_msg.rs to generate namespace id using macros
./mach build -d
does not report any errors./mach test-tidy
does not report any errors