diff options
Diffstat (limited to 'libbindgen/src')
-rw-r--r-- | libbindgen/src/clang.rs | 2 | ||||
-rw-r--r-- | libbindgen/src/ir/context.rs | 3 | ||||
-rw-r--r-- | libbindgen/src/ir/ty.rs | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/libbindgen/src/clang.rs b/libbindgen/src/clang.rs index fb495929..32424d40 100644 --- a/libbindgen/src/clang.rs +++ b/libbindgen/src/clang.rs @@ -264,7 +264,7 @@ impl Cursor { /// Given that this cursor's referent is reference type, get the cursor /// pointing to the referenced type. - pub fn referenced(&self) -> Option<Cursor> { + pub fn referenced(&self) -> Option<Cursor> { unsafe { let ret = Cursor { x: clang_getCursorReferenced(self.x), diff --git a/libbindgen/src/ir/context.rs b/libbindgen/src/ir/context.rs index 85721978..a1ec8c70 100644 --- a/libbindgen/src/ir/context.rs +++ b/libbindgen/src/ir/context.rs @@ -609,8 +609,7 @@ impl<'ctx> BindgenContext<'ctx> { -> Option<ItemId> { use clangll::{CXCursor_ClassTemplate, CXCursor_ClassTemplatePartialSpecialization, - CXCursor_TypeAliasTemplateDecl, - CXCursor_TypeRef}; + CXCursor_TypeAliasTemplateDecl, CXCursor_TypeRef}; debug!("builtin_or_resolved_ty: {:?}, {:?}, {:?}", ty, location, diff --git a/libbindgen/src/ir/ty.rs b/libbindgen/src/ir/ty.rs index 34af2db5..254568bf 100644 --- a/libbindgen/src/ir/ty.rs +++ b/libbindgen/src/ir/ty.rs @@ -667,7 +667,7 @@ impl Type { TypeKind::TemplateAlias(inner.unwrap(), args) } CXCursor_TemplateRef => { - let referenced = location.referenced().expect("expected value, got none"); + let referenced = location.referenced().unwrap(); let referenced_ty = referenced.cur_type(); let referenced_declaration = Some(referenced_ty.declaration()); @@ -679,7 +679,7 @@ impl Type { ctx); } CXCursor_TypeRef => { - let referenced = location.referenced().expect("expected value, got none"); + let referenced = location.referenced().unwrap(); let referenced_ty = referenced.cur_type(); let referenced_declaration = Some(referenced_ty.declaration()); |