easy-ext is in Debian bookworm.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
"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"
"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"
"backtrace",
"base64",
"clap",
+ "easy-ext",
"educe",
"either",
"env_logger",
- "extend",
"eyre",
"fehler",
"futures",
backtrace = "0.3"
base64 = "0.13"
clap = { version = "3", features = ["derive"] }
+easy-ext = "1"
educe = "0.4"
either = "1"
env_logger = "0.9"
# 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)
use std::str;
use std::thread::panicking;
-use extend::ext;
+use easy_ext::ext;
use nix::errno::*;
use nix::fcntl::*;
}
}
-#[ext(pub)]
-impl u32 {
+#[ext(U32Ext)]
+pub impl u32 {
fn sat(self) -> usize { self.try_into().unwrap_or(usize::MAX) }
}
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};
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;
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())
}
_ => { },
} }
}
-#[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 })
}
// 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!(