diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-29 14:50:39 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-29 17:41:26 +0100 |
commit | 442740975e41208c1cad300bc023ddedb04fc3a6 (patch) | |
tree | 01ef5d601e9aaed94c8700620ee2ee70bf91193b /openpgp-ffi/src/io.rs | |
parent | 51790b4fa46b41eba4c98b14a1193ad8e55b19b3 (diff) |
openpgp-ffi: Explicitly convert to failure::Error.
Diffstat (limited to 'openpgp-ffi/src/io.rs')
-rw-r--r-- | openpgp-ffi/src/io.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openpgp-ffi/src/io.rs b/openpgp-ffi/src/io.rs index 32309792..ca32ffca 100644 --- a/openpgp-ffi/src/io.rs +++ b/openpgp-ffi/src/io.rs @@ -19,7 +19,7 @@ pub extern "system" fn pgp_reader_from_file(errp: Option<&mut *mut failure::Erro let filename = ffi_param_cstr!(filename).to_string_lossy().into_owned(); ffi_try_box!(File::open(Path::new(&filename)) .map(|r| Box::new(r)) - .map_err(|e| e.into())) + .map_err(|e| ::failure::Error::from(e))) } /// Opens a file descriptor returning a reader. @@ -60,7 +60,7 @@ pub extern "system" fn pgp_reader_read(errp: Option<&mut *mut failure::Error>, let buf = unsafe { slice::from_raw_parts_mut(buf, len as usize) }; - ffi_try_or!(reader.read(buf).map_err(|e| e.into()), -1) as ssize_t + ffi_try_or!(reader.read(buf).map_err(|e| ::failure::Error::from(e)), -1) as ssize_t } @@ -76,7 +76,7 @@ pub extern "system" fn pgp_writer_from_file(errp: Option<&mut *mut failure::Erro let filename = ffi_param_cstr!(filename).to_string_lossy().into_owned(); ffi_try_box!(File::create(Path::new(&filename)) .map(|r| Box::new(r)) - .map_err(|e| e.into())) + .map_err(|e| ::failure::Error::from(e))) } /// Opens a file descriptor returning a writer. @@ -171,5 +171,5 @@ pub extern "system" fn pgp_writer_write(errp: Option<&mut *mut failure::Error>, let buf = unsafe { slice::from_raw_parts(buf, len as usize) }; - ffi_try_or!(writer.write(buf).map_err(|e| e.into()), -1) as ssize_t + ffi_try_or!(writer.write(buf).map_err(|e| ::failure::Error::from(e)), -1) as ssize_t } |