diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-07-09 12:51:10 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-07-15 12:47:53 +0200 |
commit | 775f0c039349335df880d35db7df6c131419f0eb (patch) | |
tree | 2d16928f3a629b7afae95cf1b9d518c5603a9f93 /openpgp-ffi/src/error.rs | |
parent | caec575e3c44e6045e29aa452ad31f91d04ec139 (diff) |
Prepare for Rust 2018.
- This is the result of running `cargo fix --edition`, with some
manual adjustments.
- The vast majority of changes merely qualify module paths with
'crate::'.
- Two instances of adding an anonymous pattern to a trait's
function.
- `async` is a keyword in Rust 2018, and hence it needs to be
escaped (e.g. in the case of the net::r#async module).
- The manual adjustments were needed due to various shortcomings of
the analysis employed by `cargo fix`, e.g. unexpanded macros,
procedural macros, lalrpop grammars.
Diffstat (limited to 'openpgp-ffi/src/error.rs')
-rw-r--r-- | openpgp-ffi/src/error.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/openpgp-ffi/src/error.rs b/openpgp-ffi/src/error.rs index bf4aeb2b..294dc1e4 100644 --- a/openpgp-ffi/src/error.rs +++ b/openpgp-ffi/src/error.rs @@ -6,34 +6,34 @@ use libc::c_char; extern crate sequoia_openpgp as openpgp; -use MoveIntoRaw; -use RefRaw; +use crate::MoveIntoRaw; +use crate::RefRaw; /// Complex errors. /// /// This wraps [`failure::Error`]s. /// /// [`failure::Error`]: https://docs.rs/failure/0.1.5/failure/struct.Error.html -#[::ffi_wrapper_type(prefix = "pgp_", derive = "Display")] +#[crate::ffi_wrapper_type(prefix = "pgp_", derive = "Display")] pub struct Error(failure::Error); impl<T> From<failure::Fallible<T>> for Status { - fn from(f: failure::Fallible<T>) -> ::error::Status { + fn from(f: failure::Fallible<T>) -> crate::error::Status { match f { - Ok(_) => ::error::Status::Success, - Err(e) => ::error::Status::from(&e), + Ok(_) => crate::error::Status::Success, + Err(e) => crate::error::Status::from(&e), } } } -impl ::MoveResultIntoRaw<::error::Status> for ::failure::Fallible<()> +impl crate::MoveResultIntoRaw<crate::error::Status> for ::failure::Fallible<()> { - fn move_into_raw(self, errp: Option<&mut *mut ::error::Error>) - -> ::error::Status { + fn move_into_raw(self, errp: Option<&mut *mut crate::error::Error>) + -> crate::error::Status { match self { - Ok(_) => ::error::Status::Success, + Ok(_) => crate::error::Status::Success, Err(e) => { - let status = ::error::Status::from(&e); + let status = crate::error::Status::from(&e); if let Some(errp) = errp { *errp = e.move_into_raw(); } @@ -150,7 +150,7 @@ pub enum Status { /// The returned value must *not* be freed. #[::sequoia_ffi_macros::extern_fn] #[no_mangle] pub extern "C" fn pgp_status_to_string(status: Status) -> *const c_char { - use error::Status::*; + use crate::error::Status::*; match status { Success => "Success\x00", |