diff options
| author | eaon <eaon@mit.edu> | 2018-11-21 20:06:21 +0100 |
|---|---|---|
| committer | eaon <eaon@mit.edu> | 2018-11-21 20:06:21 +0100 |
| commit | 4ca963a68258abed7f158ffa5289030026e11720 (patch) | |
| tree | c36707e83bc8ec8fc8e129b9acda006b2c46e97f /src/ffi.rs | |
| parent | 121856a6ef3be6a8a353f381dc319580efa8d86a (diff) | |
| download | mail-4ca963a68258abed7f158ffa5289030026e11720.tar.gz | |
Return Result<(), Status::NotmuchError> instead of Status
Diffstat (limited to 'src/ffi.rs')
| -rw-r--r-- | src/ffi.rs | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -4,6 +4,7 @@ use libc::{c_char, c_double, c_int, c_uint, c_ulong, c_void, time_t}; +use error::{Error, Result}; use std::{error, fmt, str}; use utils::ToStr; @@ -43,17 +44,17 @@ impl notmuch_status_t { !self.is_ok() } - pub fn as_result(self) -> Result<(), Self> { + pub fn as_result(self) -> Result<()> { if self.is_ok() { Ok(()) } else { - Err(self) + Err(Error::NotmuchError(Status::from(self))) } } } impl ToStr for Status { - fn to_str<'a>(&self) -> Result<&'a str, str::Utf8Error> { + fn to_str<'a>(&self) -> std::result::Result<&'a str, str::Utf8Error> { unsafe { notmuch_status_to_string((*self).into()) }.to_str() } } |
