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