summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-03 10:49:30 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-03 10:49:30 -0500
commitd152b349df84fbe1d37029315dfae04888495346 (patch)
tree8a3c695e4dc63d95dbe9ffb2322351fcf84c175a
parent5b75e39514b75696fd812e711e59ce1b53b8b412 (diff)
downloadnbsh-d152b349df84fbe1d37029315dfae04888495346.tar.gz
nbsh-d152b349df84fbe1d37029315dfae04888495346.zip
clean up some deps
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml1
-rw-r--r--src/format.rs6
-rw-r--r--src/main.rs8
-rw-r--r--src/state/history/mod.rs4
5 files changed, 12 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 90cc3c9..24de051 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -514,7 +514,6 @@ dependencies = [
"pest_derive",
"pty-process",
"serde",
- "signal-hook",
"signal-hook-async-std",
"terminal_size",
"textmode",
diff --git a/Cargo.toml b/Cargo.toml
index e02cb53..232b890 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,6 @@ pest = "2.1.3"
pest_derive = "2.1.0"
pty-process = { version = "0.2.0", features = ["async"] }
serde = { version = "1.0.133", features = ["derive"] }
-signal-hook = "0.3.13"
signal-hook-async-std = "0.2.1"
terminal_size = "0.1.17"
textmode = { version = "0.3.0", features = ["async"] }
diff --git a/src/format.rs b/src/format.rs
index e88f5a9..1560439 100644
--- a/src/format.rs
+++ b/src/format.rs
@@ -4,9 +4,9 @@ pub fn exit_status(status: std::process::ExitStatus) -> String {
status.signal().map_or_else(
|| format!("{:03} ", status.code().unwrap()),
|sig| {
- signal_hook::low_level::signal_name(sig).map_or_else(
- || format!("SIG{} ", sig),
- |name| format!("{:4} ", &name[3..]),
+ nix::sys::signal::Signal::try_from(sig).map_or_else(
+ |_| format!("SIG{} ", sig),
+ |sig| format!("{:4} ", &sig.as_str()[3..]),
)
},
)
diff --git a/src/main.rs b/src/main.rs
index 9709a32..072e717 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -60,13 +60,17 @@ async fn async_main() -> anyhow::Result<i32> {
let (event_w, event_r) = async_std::channel::unbounded();
{
+ // nix::sys::signal::Signal is repr(i32)
+ #[allow(clippy::as_conversions)]
let signals = signal_hook_async_std::Signals::new(&[
- signal_hook::consts::signal::SIGWINCH,
+ nix::sys::signal::Signal::SIGWINCH as i32,
])?;
let event_w = event_w.clone();
async_std::task::spawn(async move {
+ // nix::sys::signal::Signal is repr(i32)
+ #[allow(clippy::as_conversions)]
let mut signals = async_std::stream::once(
- signal_hook::consts::signal::SIGWINCH,
+ nix::sys::signal::Signal::SIGWINCH as i32,
)
.chain(signals);
while signals.next().await.is_some() {
diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs
index bf0c11f..fa02b98 100644
--- a/src/state/history/mod.rs
+++ b/src/state/history/mod.rs
@@ -608,6 +608,8 @@ async fn run_pipeline(
return (std::process::ExitStatus::from_raw(1 << 8), false);
}
Res::Exit(Ok(status)) => {
+ // nix::sys::signal::Signal is repr(i32)
+ #[allow(clippy::as_conversions)]
return (
status,
// i'm not sure what exactly the expected behavior here is
@@ -615,7 +617,7 @@ async fn run_pipeline(
// SIGTERM doesn't, but i don't know what the precise
// logic is or how other signals are handled
status.signal()
- == Some(signal_hook::consts::signal::SIGINT),
+ == Some(nix::sys::signal::Signal::SIGINT as i32),
);
}
Res::Exit(Err(e)) => {