-
Notifications
You must be signed in to change notification settings - Fork 747
Change clang::Type::num_elements to return Option #163
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
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.
One nit, looks good to me with that, thanks for doing this!
@@ -673,7 +673,7 @@ impl Type { | |||
CXType_ConstantArray => { | |||
let inner = Item::from_ty(&ty.elem_type(), location, parent_id, ctx) | |||
.expect("Not able to resolve array element?"); | |||
TypeKind::Array(inner, ty.num_elements()) | |||
TypeKind::Array(inner, ty.num_elements().expect("Not an array?")) |
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.
Please use unwrap()
, if this eventually fails, it's easy to trace it through gdb, and we expect this to be infallible.
Thanks!
@catdesk Can you squash your commits? I think it's good to land after squashing. |
@bors-servo r+ |
📌 Commit 7dac420 has been approved by |
Change clang::Type::num_elements to return Option Fixes #139.
☀️ Test successful - status-travis |
Fixes #139.