summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormalfunc <malfunc@dane-bre.net>2016-10-27 17:35:34 +0200
committermalfunc <malfunc@dane-bre.net>2016-10-27 17:35:34 +0200
commit486f8ff7a57dad663e9ebefa6d2f9f46a5669138 (patch)
treec6c5742f1ea0959c5352ae0dd1e4fa813392c219
parentf30ec3184bcf08d0f9462e745aaf1da23408c519 (diff)
return Result<u32, ()> instead of Option<u32>
-rwxr-xr-xsrc/clang.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/clang.rs b/src/clang.rs
index 8e5a1a4f..e3e0f313 100755
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -415,13 +415,13 @@ impl Cursor {
///
/// Returns -1 if the cursor's referent is not a function/method call or
/// declaration.
- pub fn num_args(&self) -> Option<u32> {
+ pub fn num_args(&self) -> Result<u32, ()> {
unsafe {
let w = clang_Cursor_getNumArguments(self.x);
if w == -1 {
- None
+ Err(())
} else {
- Some(w as u32)
+ Ok(w as u32)
}
}
}