From: Ian Jackson Date: Tue, 13 Dec 2022 19:39:51 +0000 (+0000) Subject: dependencies: Switch to easy-ext from extend X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=4a6c5380d196dcae4d964129c42b8e21edac9245;p=hippotat.git dependencies: Switch to easy-ext from extend easy-ext is in Debian bookworm. Signed-off-by: Ian Jackson --- diff --git a/Cargo.lock b/Cargo.lock index 021dcd9..8891f1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -181,6 +181,12 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "easy-ext" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2ddb5d6d3904e83114add6bbadf2b8307b4ae9fb4b2202afde1fe7bf3b56c0" + [[package]] name = "educe" version = "0.4.20" @@ -235,18 +241,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "extend" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5216e387a76eebaaf11f6d871ec8a4aae0b25f05456ee21f228e024b1b3610" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "eyre" version = "0.6.8" @@ -459,10 +453,10 @@ dependencies = [ "backtrace", "base64", "clap", + "easy-ext", "educe", "either", "env_logger", - "extend", "eyre", "fehler", "futures", diff --git a/Cargo.toml b/Cargo.toml index 2f76e6f..7cc7879 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ hippotat-macros = { version = "1.0.0", path = "macros" } backtrace = "0.3" base64 = "0.13" clap = { version = "3", features = ["derive"] } +easy-ext = "1" educe = "0.4" either = "1" env_logger = "0.9" @@ -62,7 +63,6 @@ void = "1" # syslog 4.0 in sid, 5.0 in upstream, ideally want 5.0 (new API) # Not in sid: -extend = "1" # no deps not in sid eyre = "0.6" # deps not in sid: indenter (see below) indenter = "0.3" # no deps not in sid fehler = "1" # no deps (other than fehler-macros, obvs) diff --git a/server/daemon.rs b/server/daemon.rs index 3d87a68..4cd0dff 100644 --- a/server/daemon.rs +++ b/server/daemon.rs @@ -11,7 +11,7 @@ use std::slice; use std::str; use std::thread::panicking; -use extend::ext; +use easy_ext::ext; use nix::errno::*; use nix::fcntl::*; diff --git a/src/config.rs b/src/config.rs index 1c8cc94..6e2a70a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -141,8 +141,8 @@ impl InspectableConfigValue for Duration { } } -#[ext(pub)] -impl u32 { +#[ext(U32Ext)] +pub impl u32 { fn sat(self) -> usize { self.try_into().unwrap_or(usize::MAX) } } diff --git a/src/prelude.rs b/src/prelude.rs index 68326df..2570fcb 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -27,7 +27,7 @@ pub use std::time::{SystemTime, UNIX_EPOCH}; pub use educe::Educe; pub use either::Either; -pub use extend::ext; +pub use easy_ext::ext; pub use fehler::{throw, throws}; pub use futures::{poll, future, FutureExt, StreamExt, TryStreamExt}; pub use hyper::body::{Bytes, Buf, HttpBody}; @@ -56,7 +56,7 @@ pub use eyre::WrapErr; pub use eyre::Error as AE; pub use crate::config::{self, InspectableConfigValue, InstanceConfig}; -pub use crate::config::{DisplayInspectable, u32Ext as _}; +pub use crate::config::{DisplayInspectable, U32Ext as _}; pub use crate::impl_inspectable_config_value; pub use crate::ini; pub use crate::ipif::Ipif; diff --git a/src/utils.rs b/src/utils.rs index 7911976..827b082 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -4,13 +4,13 @@ use crate::prelude::*; -#[ext(pub)] -impl T where T: Debug { +#[ext] +pub impl T where T: Debug { fn to_debug(&self) -> String { format!("{:?}", self) } } -#[ext(pub)] -impl Result where AE: From { +#[ext] +pub impl Result where AE: From { fn dcontext(self, d: D) -> anyhow::Result { self.map_err(|e| AE::from(e)).with_context(|| d.to_debug()) } @@ -31,8 +31,8 @@ impl ReadLimitedError { _ => { }, } } } -#[ext(pub)] -impl Result { +#[ext] +pub impl Result { fn discard_data(self) -> Self { self.map_err(|mut e| { e.discard_data(); e }) } @@ -41,8 +41,8 @@ impl Result { // Works around the lack of ErrorKind::IsADirectory // #![feature(io_error_more)] // https://github.com/rust-lang/rust/issues/86442 -#[ext(pub)] -impl io::Error { +#[ext] +pub impl io::Error { fn is_is_a_directory(&self) -> bool { self.raw_os_error() .unwrap_or_else(|| panic!(