From d5ee20c9e566db5fc8141a43f886c03377c4389e Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Mon, 7 Nov 2016 14:14:33 -0800 Subject: Use `clang::Type::is_valid` instead of checking self.kind() against CXType_Invalid --- src/clang.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/clang.rs b/src/clang.rs index b250e548..d9fbd7b8 100755 --- a/src/clang.rs +++ b/src/clang.rs @@ -640,7 +640,7 @@ impl Type { let ret = Type { x: unsafe { clang_getPointeeType(self.x) }, }; - debug_assert!(ret.kind() != CXType_Invalid); + debug_assert!(ret.is_valid()); Some(ret) } _ => None, @@ -653,7 +653,7 @@ impl Type { let current_type = Type { x: unsafe { clang_getElementType(self.x) }, }; - if current_type.kind() != CXType_Invalid { + if current_type.is_valid() { Some(current_type) } else { None @@ -692,10 +692,10 @@ impl Type { let rt = Type { x: unsafe { clang_getResultType(self.x) }, }; - if rt.kind() == CXType_Invalid { - None - } else { + if rt.is_valid() { Some(rt) + } else { + None } } -- cgit v1.2.3