Skip to content

Commit cd55e94

Browse files
committed
clang: Avoid a hot FFI call for getting the cursor kind.
This is a sorta-hot call already. I've noticed #544 wants to add more assertions about this, and was going to suggest moving them to `debug_assert!`. But there's an easier way :) Signed-off-by: Emilio Cobos Álvarez <[email protected]>
1 parent 4e4f092 commit cd55e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/clang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl Cursor {
208208

209209
/// Get the kind of referent this cursor is pointing to.
210210
pub fn kind(&self) -> CXCursorKind {
211-
unsafe { clang_getCursorKind(self.x) }
211+
self.x.kind
212212
}
213213

214214
/// Returns true is the cursor is a definition

0 commit comments

Comments
 (0)