chiark / gitweb /
eyre: switch from anyhow to eyre
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 15:19:07 +0000 (16:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Aug 2021 15:59:20 +0000 (16:59 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cargo.lock
Cargo.toml
src/prelude.rs

index ef7870263ffe7f8b56b02a14a470d613b702951d..32c7cbdd45af893e2c4800fe308f1730ae597df3 100644 (file)
@@ -20,12 +20,6 @@ dependencies = [
  "winapi",
 ]
 
-[[package]]
-name = "anyhow"
-version = "1.0.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"
-
 [[package]]
 name = "atty"
 version = "0.2.14"
@@ -174,6 +168,16 @@ dependencies = [
  "syn",
 ]
 
+[[package]]
+name = "eyre"
+version = "0.6.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b"
+dependencies = [
+ "indenter",
+ "once_cell",
+]
+
 [[package]]
 name = "fehler"
 version = "1.0.0"
@@ -377,12 +381,12 @@ dependencies = [
 name = "hippotat"
 version = "0.0.0"
 dependencies = [
- "anyhow",
  "base64",
  "cervine",
  "configparser",
  "env_logger",
  "extend",
+ "eyre",
  "fehler",
  "futures",
  "hippotat-macros",
@@ -488,6 +492,12 @@ dependencies = [
  "tokio-native-tls",
 ]
 
+[[package]]
+name = "indenter"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
+
 [[package]]
 name = "indexmap"
 version = "1.7.0"
index 80f3614437e609c6fefd6eda39e527bbcabd82d5..a86ae567a600ab64ff560db99a8e2ce6faa433cb 100644 (file)
@@ -27,7 +27,6 @@ hippotat-macros = { path = "macros" }
 
 # versions specified here are mostly just guesses at what is needed
 # (or currently available):
-anyhow = "1" # todo: switch to eyre, better display of errors
 base64 = "0.13"
 configparser = "2"
 env_logger = "0.9"
@@ -47,6 +46,8 @@ void = "1"
 
 # Not in sid:
 extend = "1"           # no deps not in sid
+eyre = "0.6"           # deps not in sid: 
+# indenter             # no deps not in sid
 fehler = "1"           # no deps (other than fehler-macros, obvs)
 lazy-regex = "2"       # no deps not in sid
 cervine = "0.0"                # no (non-dev)-deps not in sid
index fd9fd835fdc1e9a91615828548efb2961b5e6898..277513a18501ebf3b326f3298717ea4cc04d6709 100644 (file)
@@ -23,7 +23,6 @@ pub use std::sync::Arc;
 pub use std::task::Poll;
 pub use std::time::{SystemTime, UNIX_EPOCH};
 
-pub use anyhow::{anyhow, Context};
 pub use cervine::Cow as Cervine;
 pub use extend::ext;
 pub use fehler::{throw, throws};
@@ -44,6 +43,11 @@ pub use tokio::task;
 pub use tokio::time::{Duration, Instant};
 pub use void::{self, Void, ResultVoidExt, ResultVoidErrExt};
 
+pub use eyre as anyhow;
+pub use eyre::eyre as anyhow;
+pub use eyre::WrapErr;
+pub use eyre::Error as AE;
+
 pub use crate::config::{self, InstanceConfig, u32Ext as _};
 pub use crate::utils::*;
 pub use crate::queue::*;
@@ -53,7 +57,6 @@ pub use crate::slip::*;
 
 pub type ReqNum = u64;
 
-pub use anyhow::Error as AE;
 pub use ErrorKind as EK;
 pub use PacketError as PE;