File tree 3 files changed +4
-5
lines changed
3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ impl Cursor {
264
264
265
265
/// Given that this cursor's referent is reference type, get the cursor
266
266
/// pointing to the referenced type.
267
- pub fn referenced ( & self ) -> Option < Cursor > {
267
+ pub fn referenced ( & self ) -> Option < Cursor > {
268
268
unsafe {
269
269
let ret = Cursor {
270
270
x : clang_getCursorReferenced ( self . x ) ,
Original file line number Diff line number Diff line change @@ -590,8 +590,7 @@ impl<'ctx> BindgenContext<'ctx> {
590
590
-> Option < ItemId > {
591
591
use clangll:: { CXCursor_ClassTemplate ,
592
592
CXCursor_ClassTemplatePartialSpecialization ,
593
- CXCursor_TypeAliasTemplateDecl ,
594
- CXCursor_TypeRef } ;
593
+ CXCursor_TypeAliasTemplateDecl , CXCursor_TypeRef } ;
595
594
debug ! ( "builtin_or_resolved_ty: {:?}, {:?}, {:?}" ,
596
595
ty,
597
596
location,
Original file line number Diff line number Diff line change @@ -667,7 +667,7 @@ impl Type {
667
667
TypeKind :: TemplateAlias ( inner. unwrap ( ) , args)
668
668
}
669
669
CXCursor_TemplateRef => {
670
- let referenced = location. referenced ( ) . expect ( "expected value, got none" ) ;
670
+ let referenced = location. referenced ( ) . unwrap ( ) ;
671
671
let referenced_ty = referenced. cur_type ( ) ;
672
672
let referenced_declaration =
673
673
Some ( referenced_ty. declaration ( ) ) ;
@@ -679,7 +679,7 @@ impl Type {
679
679
ctx) ;
680
680
}
681
681
CXCursor_TypeRef => {
682
- let referenced = location. referenced ( ) . expect ( "expected value, got none" ) ;
682
+ let referenced = location. referenced ( ) . unwrap ( ) ;
683
683
let referenced_ty = referenced. cur_type ( ) ;
684
684
let referenced_declaration =
685
685
Some ( referenced_ty. declaration ( ) ) ;
You can’t perform that action at this time.
0 commit comments