diff options
71 files changed, 237 insertions, 336 deletions
@@ -22,6 +22,11 @@ dependencies = [ ] [[package]] +name = "anyhow" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "arrayref" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1559,8 +1564,8 @@ dependencies = [ name = "sequoia-core" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1569,7 +1574,7 @@ dependencies = [ name = "sequoia-ffi" version = "0.15.0" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1598,7 +1603,7 @@ dependencies = [ name = "sequoia-guide" version = "0.15.0" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "sequoia-openpgp 0.15.0", ] @@ -1606,9 +1611,9 @@ dependencies = [ name = "sequoia-ipc" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "capnp-rpc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lalrpop 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1629,7 +1634,7 @@ dependencies = [ name = "sequoia-net" version = "0.15.0" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1652,10 +1657,10 @@ dependencies = [ name = "sequoia-openpgp" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "buffered-reader 0.14.0", "bzip2 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "lalrpop 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1675,7 +1680,7 @@ dependencies = [ name = "sequoia-openpgp-ffi" version = "0.15.0" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1688,11 +1693,11 @@ dependencies = [ name = "sequoia-sqv" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "assert_cli 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "sequoia-openpgp 0.15.0", ] @@ -1700,10 +1705,10 @@ dependencies = [ name = "sequoia-store" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "capnp 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)", "capnp-rpc 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "capnpc 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "rusqlite 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1720,12 +1725,12 @@ dependencies = [ name = "sequoia-tool" version = "0.15.0" dependencies = [ + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "assert_cli 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossterm 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "prettytable-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2262,6 +2267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" "checksum aho-corasick 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e63fd144e18ba274ae7095c0197a870a7b9468abc801dd62f190d80817d2ec" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" "checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" "checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" "checksum ascii-canvas 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8eb72df928aafb99fe5d37b383f2fe25bd2a765e3e5f7c365916b6f2463a29" diff --git a/core/Cargo.toml b/core/Cargo.toml index d6a95c53..f3f013f8 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -21,7 +21,7 @@ gitlab = { repository = "sequoia-pgp/sequoia" } maintenance = { status = "actively-developed" } [dependencies] +anyhow = "1" dirs = "2.0" -failure = "0.1.2" tempfile = "3.1" thiserror = "1" diff --git a/core/src/lib.rs b/core/src/lib.rs index aa6ba30d..5db7e6bf 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -20,8 +20,6 @@ extern crate dirs; extern crate tempfile; -#[macro_use] -extern crate failure; use std::fmt; use std::io; @@ -199,7 +197,7 @@ impl Config { if home_not_set { c.home = dirs::home_dir().ok_or( - format_err!("Failed to get users home directory"))? + anyhow::anyhow!("Failed to get users home directory"))? .join(".sequoia"); } } @@ -266,7 +264,7 @@ impl Config { /* Error handling. */ /// Result type for Sequoia. -pub type Result<T> = ::std::result::Result<T, failure::Error>; +pub type Result<T> = ::std::result::Result<T, anyhow::Error>; #[derive(thiserror::Error, Debug)] /// Errors for Sequoia. diff --git a/ffi-macros/src/lib.rs b/ffi-macros/src/lib.rs index e4107c49..8b315b72 100644 --- a/ffi-macros/src/lib.rs +++ b/ffi-macros/src/lib.rs @@ -648,7 +648,7 @@ fn derive_conversion_functions(mut st: syn::ItemStruct, } impl #generics crate::MoveResultIntoRaw<Option<::std::ptr::NonNull<#wrapper #generics>>> - for ::failure::Fallible<#wrapped> + for ::anyhow::Result<#wrapped> { fn move_into_raw(self, errp: Option<&mut *mut crate::error::Error>) -> Option<::std::ptr::NonNull<#wrapper #generics>> @@ -670,7 +670,7 @@ fn derive_conversion_functions(mut st: syn::ItemStruct, } impl #generics crate::MoveResultIntoRaw<Option<::std::ptr::NonNull<#wrapper #generics>>> - for ::failure::Fallible<&#wrapped> + for ::anyhow::Result<&#wrapped> { fn move_into_raw(self, errp: Option<&mut *mut crate::error::Error>) -> Option<::std::ptr::NonNull<#wrapper #generics>> @@ -692,7 +692,7 @@ fn derive_conversion_functions(mut st: syn::ItemStruct, } impl #generics crate::MoveResultIntoRaw<Option<::std::ptr::NonNull<#wrapper #generics>>> - for ::failure::Fallible<&mut #wrapped> + for ::anyhow::Result<&mut #wrapped> { fn move_into_raw(self, errp: Option<&mut *mut crate::error::Error>) -> Option<::std::ptr::NonNull<#wrapper #generics>> diff --git a/ffi/Cargo.toml b/ffi/Cargo.toml index aec51a28..7afd7f61 100644 --- a/ffi/Cargo.toml +++ b/ffi/Cargo.toml @@ -27,7 +27,7 @@ sequoia-openpgp = { path = "../openpgp", version = "0.15" } sequoia-core = { path = "../core", version = "0.15" } sequoia-store = { path = "../store", version = "0.15" } sequoia-net = { path = "../net", version = "0.15" } -failure = "0.1.2" +anyhow = "1" lazy_static = "1.0.0" libc = "0.2.33" memsec = "0.5.6" diff --git a/ffi/src/error.rs b/ffi/src/error.rs index 331bad04..26940111 100644 --- a/ffi/src/error.rs +++ b/ffi/src/error.rs @@ -1,6 +1,5 @@ //! Maps various errors to status codes. -use failure; use std::io; extern crate sequoia_openpgp as openpgp; @@ -10,11 +9,11 @@ pub use crate::openpgp::error::Status; pub(crate) use crate::openpgp::error::Error; trait FromSequoiaError<'a> { - fn from_sequoia_error(_: &'a failure::Error) -> Status; + fn from_sequoia_error(_: &'a anyhow::Error) -> Status; } impl<'a> FromSequoiaError<'a> for Status { - fn from_sequoia_error(e: &'a failure::Error) -> Self { + fn from_sequoia_error(e: &'a anyhow::Error) -> Self { if let Some(e) = e.downcast_ref::<core::Error>() { return match e { &core::Error::NetworkPolicyViolation(_) => diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index 2d081c3e..ab2819ae 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -107,7 +107,6 @@ #![warn(missing_docs)] -extern crate failure; #[macro_use] extern crate lazy_static; extern crate libc |