summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRémy HUBSCHER <rhubscher@mozilla.com>2016-11-04 16:31:28 +0100
committerRémy HUBSCHER <rhubscher@mozilla.com>2016-11-04 16:32:07 +0100
commitb49bfea05b9cd4986a0f535e3193f2889e9db93b (patch)
tree997ab74770c76d58d7d7d5541af8636540846c23 /src
parent624c32c93ccdd4ed34a6e827b063f272fbad36b0 (diff)
Make clang::Cursor::ret_type return an Option<Type> — Fixes #131
Diffstat (limited to 'src')
-rwxr-xr-xsrc/clang.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/clang.rs b/src/clang.rs
index b335a585..dd4bcdf8 100755
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -402,11 +402,12 @@ impl Cursor {
/// Given that this cursor's referent is a function/method call or
/// declaration, return a cursor to its return type.
- pub fn ret_type(&self) -> Type {
+ pub fn ret_type(&self) -> Option<Type> {
unsafe {
- Type {
+ let ret = Type {
x: clang_getCursorResultType(self.x),
- }
+ };
+ if true { Some(ret) } else { None }
}
}