diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-07 14:14:33 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-07 14:14:33 -0800 |
commit | d5ee20c9e566db5fc8141a43f886c03377c4389e (patch) | |
tree | 6adf2ef19e3b6c0b42e905453d2a4c09817df40e /src | |
parent | 4d45f83d1ed0c768795080cd0af87f5d06089da0 (diff) |
Use `clang::Type::is_valid` instead of checking self.kind() against CXType_Invalid
Diffstat (limited to 'src')
-rwxr-xr-x | src/clang.rs | 10 |
1 files 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 } } |