chiark / gitweb /
dependencies: Switch to easy-ext from extend
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 13 Dec 2022 19:39:51 +0000 (19:39 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Dec 2022 21:52:29 +0000 (21:52 +0000)
easy-ext is in Debian bookworm.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Cargo.lock
Cargo.toml
server/daemon.rs
src/config.rs
src/prelude.rs
src/utils.rs

index 021dcd9a9aa1ee2e7454056c7e39a510afd09e9c..8891f1fbefa3ea6375bd36d94b40b02d43b5bcb7 100644 (file)
@@ -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",
index 2f76e6fd823c624002c382cb71a15faab7920c6b..7cc78794b0f5431d5a387c7e5ce8fb10ea6f39f7 100644 (file)
@@ -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)
index 3d87a688533e080f13f3b9c366b0f21535dc2017..4cd0dff7b98e1d0505591bf862aff9532a55f019 100644 (file)
@@ -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::*;
index 1c8cc94b86d14556bb6f1ba39f267f5053a9fa41..6e2a70a74375936213abc43f3fe9b1d1cbce3823 100644 (file)
@@ -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) }
 }
 
index 68326df096a832ccd2812069186227a6ecac6dd4..2570fcb31a871f2cb84ca18d8ecf6653b8d494af 100644 (file)
@@ -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;
index 7911976e7d36d640ffd5fb76a671564af6c9325b..827b082aa2ad12402bce32d588b61879921624a4 100644 (file)
@@ -4,13 +4,13 @@
 
 use crate::prelude::*;
 
-#[ext(pub)]
-impl<T> T where T: Debug {
+#[ext]
+pub impl<T> T where T: Debug {
   fn to_debug(&self) -> String { format!("{:?}", self) }
 }
 
-#[ext(pub)]
-impl<T,E> Result<T,E> where AE: From<E> {
+#[ext]
+pub impl<T,E> Result<T,E> where AE: From<E> {
   fn dcontext<D:Debug>(self, d: D) -> anyhow::Result<T> {
     self.map_err(|e| AE::from(e)).with_context(|| d.to_debug())
   }
@@ -31,8 +31,8 @@ impl ReadLimitedError {
     _ => { },
   } }
 }
-#[ext(pub)]
-impl<T> Result<T,ReadLimitedError> {
+#[ext]
+pub impl<T> Result<T,ReadLimitedError> {
   fn discard_data(self) -> Self {
     self.map_err(|mut e| { e.discard_data(); e })
   }
@@ -41,8 +41,8 @@ impl<T> Result<T,ReadLimitedError> {
 // 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!(