File tree 1 file changed +4
-4
lines changed 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ impl Cursor {
110
110
/// See documentation for `lexical_parent` for details on semantic vs
111
111
/// lexical parents.
112
112
pub fn fallible_semantic_parent ( & self ) -> Option < Cursor > {
113
- let sp = self . semantic_parent ( ) ;
113
+ let sp = unsafe {
114
+ Cursor { x : clang_getCursorSemanticParent ( self . x ) }
115
+ } ;
114
116
if sp == * self || !sp. is_valid ( ) {
115
117
return None ;
116
118
}
@@ -122,9 +124,7 @@ impl Cursor {
122
124
/// See documentation for `lexical_parent` for details on semantic vs
123
125
/// lexical parents.
124
126
pub fn semantic_parent ( & self ) -> Cursor {
125
- unsafe {
126
- Cursor { x : clang_getCursorSemanticParent ( self . x ) }
127
- }
127
+ self . fallible_semantic_parent ( ) . unwrap ( )
128
128
}
129
129
130
130
/// Return the number of template arguments used by this cursor's referent,
You can’t perform that action at this time.
0 commit comments