-
Notifications
You must be signed in to change notification settings - Fork 745
Fix #121: Cursor::num_template_args(...) returns Option<u32> instead of c_int #182
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
Conversation
… instead of c_int
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 good, please take care of that nit and I'll merge it.
@@ -192,7 +197,8 @@ impl Cursor { | |||
/// Is the referent a fully specialized template specialization without any | |||
/// remaining free template arguments? | |||
pub fn is_fully_specialized_template(&self) -> bool { | |||
self.is_template() && self.num_template_args() > 0 | |||
self.is_template() && self.num_template_args() | |||
.expect("Not a class template specialization") > 0 |
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.
can you call unwrap
directly? It's clear from the backtrace what the failure is.
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.
Ok will do the change, thanks for the feedback
Thanks for doing this, that was fast! :) |
@bors-servo r+ |
📌 Commit 664786a has been approved by |
⚡ Test exempted - status |
Fix #121: Cursor::num_template_args(...) returns Option<u32> instead of c_int Now, functions calling Cursor::num_template_args() call expect() on the return value to make sure it is a valid value
Now, functions calling Cursor::num_template_args() call expect() on the return value to make sure it is a valid value