summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-02-27 11:15:02 -0800
committerGitHub <noreply@github.com>2017-02-27 11:15:02 -0800
commit49b4dc83c4b849a9c60f92de4231ed6b9761dcef (patch)
tree474231cd265e7bfc4c3c4760db79c236921ccf12
parent4e4f092d603828647bae12754a57c59efdfee005 (diff)
parentcd55e94b20d9e2b2f04712cb655c9075aab4e143 (diff)
Auto merge of #545 - emilio:simplify-ffi, r=fitzgen
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 :) r? @fitzgen
-rw-r--r--src/clang.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 1a45eefa..35dd7cc3 100644
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -208,7 +208,7 @@ impl Cursor {
/// Get the kind of referent this cursor is pointing to.
pub fn kind(&self) -> CXCursorKind {
- unsafe { clang_getCursorKind(self.x) }
+ self.x.kind
}
/// Returns true is the cursor is a definition