Skip to content

Commit 19c7d93

Browse files
committed
cargo fmt
1 parent 7fa654c commit 19c7d93

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
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)
@@ -712,10 +712,12 @@ impl Type {
712712
/// If this type is a class template specialization, return its
713713
/// template arguments. Otherwise, return None.
714714
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+
}
719721
})
720722
}
721723

@@ -817,9 +819,8 @@ impl Type {
817819
// Yep, the spelling of this containing type-parameter is extremely
818820
// nasty... But can happen in <type_traits>. Unfortunately I couldn't
819821
// 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() {
823824
CXCursor_ClassTemplatePartialSpecialization |
824825
CXCursor_TypeAliasTemplateDecl |
825826
CXCursor_TemplateTemplateParameter => false,
@@ -1381,7 +1382,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
13811382
print_cursor(depth,
13821383
String::from(prefix) + "referenced.",
13831384
&refd);
1384-
print_cursor(depth, String::from(prefix) + "referenced.", &refd);
1385+
print_cursor(depth,
1386+
String::from(prefix) + "referenced.",
1387+
&refd);
13851388
}
13861389
}
13871390

@@ -1391,7 +1394,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
13911394
print_cursor(depth,
13921395
String::from(prefix) + "canonical.",
13931396
&canonical);
1394-
print_cursor(depth, String::from(prefix) + "canonical.", &canonical);
1397+
print_cursor(depth,
1398+
String::from(prefix) + "canonical.",
1399+
&canonical);
13951400
}
13961401

13971402
if let Some(specialized) = c.specialized() {
@@ -1400,7 +1405,9 @@ pub fn ast_dump(c: &Cursor, depth: isize) -> CXChildVisitResult {
14001405
print_cursor(depth,
14011406
String::from(prefix) + "specialized.",
14021407
&specialized);
1403-
print_cursor(depth, String::from(prefix) + "specialized.", &specialized);
1408+
print_cursor(depth,
1409+
String::from(prefix) + "specialized.",
1410+
&specialized);
14041411
}
14051412
}
14061413
}

src/ir/ty.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,9 @@ impl Type {
623623
// assume this is a Comp(..)
624624
} else if ty.is_fully_specialized_template() {
625625
debug!("Template specialization: {:?}, {:?} {:?}",
626-
ty, location, canonical_ty);
626+
ty,
627+
location,
628+
canonical_ty);
627629
let complex =
628630
CompInfo::from_ty(potential_id, ty, location, ctx)
629631
.expect("C'mon");

0 commit comments

Comments
 (0)