@@ -132,11 +132,11 @@ impl Cursor {
132
132
// `clang_Cursor_getNumTemplateArguments` is totally unreliable.
133
133
// Therefore, try former first, and only fallback to the latter if we
134
134
// have to.
135
- self . cur_type ( ) . num_template_args ( )
135
+ self . cur_type ( )
136
+ . num_template_args ( )
136
137
. or_else ( || {
137
- let n: c_int = unsafe {
138
- clang_Cursor_getNumTemplateArguments ( self . x )
139
- } ;
138
+ let n: c_int =
139
+ unsafe { clang_Cursor_getNumTemplateArguments ( self . x ) } ;
140
140
141
141
if n >= 0 {
142
142
Some ( n as u32 )
@@ -712,10 +712,12 @@ impl Type {
712
712
/// If this type is a class template specialization, return its
713
713
/// template arguments. Otherwise, return None.
714
714
pub fn template_args ( & self ) -> Option < TypeTemplateArgIterator > {
715
- self . num_template_args ( ) . map ( |n| TypeTemplateArgIterator {
716
- x : self . x ,
717
- length : n,
718
- index : 0 ,
715
+ self . num_template_args ( ) . map ( |n| {
716
+ TypeTemplateArgIterator {
717
+ x : self . x ,
718
+ length : n,
719
+ index : 0 ,
720
+ }
719
721
} )
720
722
}
721
723
@@ -817,9 +819,8 @@ impl Type {
817
819
// Yep, the spelling of this containing type-parameter is extremely
818
820
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
819
821
// reduce it enough :(
820
- self . template_args ( ) . map_or ( false , |args| {
821
- args. len ( ) > 0
822
- } ) && match self . declaration ( ) . kind ( ) {
822
+ self . template_args ( ) . map_or ( false , |args| args. len ( ) > 0 ) &&
823
+ match self . declaration ( ) . kind ( ) {
823
824
CXCursor_ClassTemplatePartialSpecialization |
824
825
CXCursor_TypeAliasTemplateDecl |
825
826
CXCursor_TemplateTemplateParameter => false ,
@@ -1381,7 +1382,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1381
1382
print_cursor ( depth,
1382
1383
String :: from ( prefix) + "referenced." ,
1383
1384
& refd) ;
1384
- print_cursor ( depth, String :: from ( prefix) + "referenced." , & refd) ;
1385
+ print_cursor ( depth,
1386
+ String :: from ( prefix) + "referenced." ,
1387
+ & refd) ;
1385
1388
}
1386
1389
}
1387
1390
@@ -1391,7 +1394,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1391
1394
print_cursor ( depth,
1392
1395
String :: from ( prefix) + "canonical." ,
1393
1396
& canonical) ;
1394
- print_cursor ( depth, String :: from ( prefix) + "canonical." , & canonical) ;
1397
+ print_cursor ( depth,
1398
+ String :: from ( prefix) + "canonical." ,
1399
+ & canonical) ;
1395
1400
}
1396
1401
1397
1402
if let Some ( specialized) = c. specialized ( ) {
@@ -1400,7 +1405,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1400
1405
print_cursor ( depth,
1401
1406
String :: from ( prefix) + "specialized." ,
1402
1407
& specialized) ;
1403
- print_cursor ( depth, String :: from ( prefix) + "specialized." , & specialized) ;
1408
+ print_cursor ( depth,
1409
+ String :: from ( prefix) + "specialized." ,
1410
+ & specialized) ;
1404
1411
}
1405
1412
}
1406
1413
}
0 commit comments