Remove mio

This commit is contained in:
Marcin Kulik
2024-01-06 21:48:58 +01:00
parent aaad9ecec2
commit cad9b2e291
3 changed files with 4 additions and 21 deletions

14
Cargo.lock generated
View File

@@ -89,14 +89,12 @@ dependencies = [
"anyhow",
"clap",
"config",
"mio",
"nix",
"reqwest",
"rustyline",
"serde",
"serde_json",
"signal-hook",
"signal-hook-mio",
"termion",
"uuid",
]
@@ -666,7 +664,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
dependencies = [
"libc",
"log",
"wasi",
"windows-sys 0.48.0",
]
@@ -1020,17 +1017,6 @@ dependencies = [
"signal-hook-registry",
]
[[package]]
name = "signal-hook-mio"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af"
dependencies = [
"libc",
"mio",
"signal-hook",
]
[[package]]
name = "signal-hook-registry"
version = "1.4.1"

View File

@@ -13,12 +13,10 @@ license = "GPL-3.0"
[dependencies]
anyhow = "1.0.75"
nix = { version = "0.27", features = [ "fs", "term", "process", "signal" ] }
mio = { version ="0.8", features = ["os-poll", "os-ext"] }
termion = "2.0.1"
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
clap = { version = "4.4.7", features = ["derive"] }
signal-hook-mio = { version = "0.2.3", features = ["support-v0_8"] }
signal-hook = "0.3.17"
uuid = { version = "1.6.1", features = ["v4"] }
reqwest = { version = "0.11.23", default-features = false, features = ["blocking", "rustls-tls", "multipart", "gzip", "json"] }

View File

@@ -1,6 +1,5 @@
use anyhow::Result;
use mio::unix::pipe;
use nix::{libc, pty};
use nix::{libc, pty, unistd};
use std::{
fs, io,
os::fd::{AsFd, AsRawFd, BorrowedFd},
@@ -67,13 +66,13 @@ impl AsFd for DevTty {
}
pub struct DevNull {
tx: pipe::Sender,
_rx: pipe::Receiver,
tx: i32,
_rx: i32,
}
impl DevNull {
pub fn open() -> Result<Self> {
let (tx, rx) = pipe::new()?;
let (rx, tx) = unistd::pipe()?;
Ok(Self { tx, _rx: rx })
}