Skip to content

Commit 3f727d6

Browse files
committed
cargo fmt
1 parent 8264afa commit 3f727d6

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

src/clang.rs

+21-14
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ impl Cursor {
132132
// `clang_Cursor_getNumTemplateArguments` is totally unreliable.
133133
// Therefore, try former first, and only fallback to the latter if we
134134
// have to.
135-
self.cur_type().num_template_args()
135+
self.cur_type()
136+
.num_template_args()
136137
.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) };
140140

141141
if n >= 0 {
142142
Some(n as u32)
@@ -723,10 +723,12 @@ impl Type {
723723
/// If this type is a class template specialization, return its
724724
/// template arguments. Otherwise, return None.
725725
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+
}
730732
})
731733
}
732734

@@ -828,9 +830,8 @@ impl Type {
828830
// Yep, the spelling of this containing type-parameter is extremely
829831
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
830832
// 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() {
834835
CXCursor_ClassTemplatePartialSpecialization |
835836
CXCursor_TypeAliasTemplateDecl |
836837
CXCursor_TemplateTemplateParameter => false,
@@ -1392,7 +1393,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
13921393
print_cursor(depth,
13931394
String::from(prefix) + "referenced.",
13941395
&refd);
1395-
print_cursor(depth, String::from(prefix) + "referenced.", &refd);
1396+
print_cursor(depth,
1397+
String::from(prefix) + "referenced.",
1398+
&refd);
13961399
}
13971400
}
13981401

@@ -1402,7 +1405,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
14021405
print_cursor(depth,
14031406
String::from(prefix) + "canonical.",
14041407
&canonical);
1405-
print_cursor(depth, String::from(prefix) + "canonical.", &canonical);
1408+
print_cursor(depth,
1409+
String::from(prefix) + "canonical.",
1410+
&canonical);
14061411
}
14071412

14081413
if let Some(specialized) = c.specialized() {
@@ -1411,7 +1416,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
14111416
print_cursor(depth,
14121417
String::from(prefix) + "specialized.",
14131418
&specialized);
1414-
print_cursor(depth, String::from(prefix) + "specialized.", &specialized);
1419+
print_cursor(depth,
1420+
String::from(prefix) + "specialized.",
1421+
&specialized);
14151422
}
14161423
}
14171424
}

0 commit comments

Comments
 (0)