@@ -102,7 +102,9 @@ impl Cursor {
102
102
/// lexical parents.
103
103
pub fn fallible_semantic_parent ( & self ) -> Option < Cursor > {
104
104
let sp = unsafe {
105
- Cursor { x : clang_getCursorSemanticParent ( self . x ) }
105
+ Cursor {
106
+ x : clang_getCursorSemanticParent ( self . x ) ,
107
+ }
106
108
} ;
107
109
if sp == * self || !sp. is_valid ( ) {
108
110
return None ;
@@ -161,7 +163,8 @@ impl Cursor {
161
163
( semantic_parent. unwrap ( ) . kind ( ) == CXCursor_Namespace ||
162
164
semantic_parent. unwrap ( ) . kind ( ) == CXCursor_NamespaceAlias ||
163
165
semantic_parent. unwrap ( ) . kind ( ) == CXCursor_NamespaceRef ) {
164
- semantic_parent = semantic_parent. unwrap ( ) . fallible_semantic_parent ( ) ;
166
+ semantic_parent = semantic_parent. unwrap ( )
167
+ . fallible_semantic_parent ( ) ;
165
168
}
166
169
167
170
let tu = self . translation_unit ( ) ;
@@ -363,9 +366,9 @@ impl Cursor {
363
366
///
364
367
/// Returns None if the cursor's referent is not an enum variant.
365
368
pub fn enum_val_unsigned ( & self ) -> Option < u64 > {
366
- unsafe {
369
+ unsafe {
367
370
if self . kind ( ) == CXCursor_EnumConstantDecl {
368
- Some ( clang_getEnumConstantDeclUnsignedValue ( self . x ) as u64 )
371
+ Some ( clang_getEnumConstantDeclUnsignedValue ( self . x ) as u64 )
369
372
} else {
370
373
None
371
374
}
@@ -691,11 +694,7 @@ impl Type {
691
694
let rt = Type {
692
695
x : unsafe { clang_getResultType ( self . x ) } ,
693
696
} ;
694
- if rt. is_valid ( ) {
695
- Some ( rt)
696
- } else {
697
- None
698
- }
697
+ if rt. is_valid ( ) { Some ( rt) } else { None }
699
698
}
700
699
701
700
/// Given that this type is a function type, get its calling convention. If
0 commit comments