@@ -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 )
@@ -723,10 +723,12 @@ impl Type {
723
723
/// If this type is a class template specialization, return its
724
724
/// template arguments. Otherwise, return None.
725
725
pub fn template_args ( & self ) -> Option < TypeTemplateArgIterator > {
726
- self . num_template_args ( ) . map ( |n| TypeTemplateArgIterator {
727
- x : self . x ,
728
- length : n,
729
- index : 0 ,
726
+ self . num_template_args ( ) . map ( |n| {
727
+ TypeTemplateArgIterator {
728
+ x : self . x ,
729
+ length : n,
730
+ index : 0 ,
731
+ }
730
732
} )
731
733
}
732
734
@@ -828,9 +830,8 @@ impl Type {
828
830
// Yep, the spelling of this containing type-parameter is extremely
829
831
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
830
832
// reduce it enough :(
831
- self . template_args ( ) . map_or ( false , |args| {
832
- args. len ( ) > 0
833
- } ) && match self . declaration ( ) . kind ( ) {
833
+ self . template_args ( ) . map_or ( false , |args| args. len ( ) > 0 ) &&
834
+ match self . declaration ( ) . kind ( ) {
834
835
CXCursor_ClassTemplatePartialSpecialization |
835
836
CXCursor_TypeAliasTemplateDecl |
836
837
CXCursor_TemplateTemplateParameter => false ,
@@ -1392,7 +1393,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1392
1393
print_cursor ( depth,
1393
1394
String :: from ( prefix) + "referenced." ,
1394
1395
& refd) ;
1395
- print_cursor ( depth, String :: from ( prefix) + "referenced." , & refd) ;
1396
+ print_cursor ( depth,
1397
+ String :: from ( prefix) + "referenced." ,
1398
+ & refd) ;
1396
1399
}
1397
1400
}
1398
1401
@@ -1402,7 +1405,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1402
1405
print_cursor ( depth,
1403
1406
String :: from ( prefix) + "canonical." ,
1404
1407
& canonical) ;
1405
- print_cursor ( depth, String :: from ( prefix) + "canonical." , & canonical) ;
1408
+ print_cursor ( depth,
1409
+ String :: from ( prefix) + "canonical." ,
1410
+ & canonical) ;
1406
1411
}
1407
1412
1408
1413
if let Some ( specialized) = c. specialized ( ) {
@@ -1411,7 +1416,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
1411
1416
print_cursor ( depth,
1412
1417
String :: from ( prefix) + "specialized." ,
1413
1418
& specialized) ;
1414
- print_cursor ( depth, String :: from ( prefix) + "specialized." , & specialized) ;
1419
+ print_cursor ( depth,
1420
+ String :: from ( prefix) + "specialized." ,
1421
+ & specialized) ;
1415
1422
}
1416
1423
}
1417
1424
}
0 commit comments