Skip to content

Commit 04f98a0

Browse files
committed
cargo fmt.
1 parent ade9ebc commit 04f98a0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/clang.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ impl Cursor {
102102
/// lexical parents.
103103
pub fn fallible_semantic_parent(&self) -> Option<Cursor> {
104104
let sp = unsafe {
105-
Cursor { x: clang_getCursorSemanticParent(self.x) }
105+
Cursor {
106+
x: clang_getCursorSemanticParent(self.x),
107+
}
106108
};
107109
if sp == *self || !sp.is_valid() {
108110
return None;
@@ -161,7 +163,8 @@ impl Cursor {
161163
(semantic_parent.unwrap().kind() == CXCursor_Namespace ||
162164
semantic_parent.unwrap().kind() == CXCursor_NamespaceAlias ||
163165
semantic_parent.unwrap().kind() == CXCursor_NamespaceRef) {
164-
semantic_parent = semantic_parent.unwrap().fallible_semantic_parent();
166+
semantic_parent = semantic_parent.unwrap()
167+
.fallible_semantic_parent();
165168
}
166169

167170
let tu = self.translation_unit();
@@ -363,9 +366,9 @@ impl Cursor {
363366
///
364367
/// Returns None if the cursor's referent is not an enum variant.
365368
pub fn enum_val_unsigned(&self) -> Option<u64> {
366-
unsafe {
369+
unsafe {
367370
if self.kind() == CXCursor_EnumConstantDecl {
368-
Some(clang_getEnumConstantDeclUnsignedValue(self.x) as u64)
371+
Some(clang_getEnumConstantDeclUnsignedValue(self.x) as u64)
369372
} else {
370373
None
371374
}
@@ -691,11 +694,7 @@ impl Type {
691694
let rt = Type {
692695
x: unsafe { clang_getResultType(self.x) },
693696
};
694-
if rt.is_valid() {
695-
Some(rt)
696-
} else {
697-
None
698-
}
697+
if rt.is_valid() { Some(rt) } else { None }
699698
}
700699

701700
/// Given that this type is a function type, get its calling convention. If

0 commit comments

Comments
 (0)