diff options
-rwxr-xr-x | src/clang.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/clang.rs b/src/clang.rs index 3f23cbb6..f8aac1c1 100755 --- a/src/clang.rs +++ b/src/clang.rs @@ -289,14 +289,10 @@ impl Cursor { /// pointing to the template definition that is being specialized. pub fn specialized(&self) -> Option<Cursor> { unsafe { - let clang_specialized = clang_getSpecializedCursorTemplate(self.x); - if clang_isInvalid(clang_getCursorKind(clang_specialized)) == 0 { - Some(Cursor { - x: clang_specialized, - }) - } else { - None - } + let ret = Cursor { + x: clang_getSpecializedCursorTemplate(self.x) + }; + if ret.is_valid() { Some(ret) } else { None } } } |