Skip to content

Commit 111508f

Browse files
committed
docs: update docs
1 parent 8c18cac commit 111508f

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

crates/libs/kill_tree/src/blocking.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ pub fn get_available_max_process_id() -> u32 {
7474
/// This is an error that should not occur under normal circumstances.
7575
///
7676
/// ## `InvalidProcEntry`
77-
/// TODO
77+
/// Returned when inquiry, or parsing within the Linux `/proc/` path fails.
78+
///
79+
/// ## `Io`
80+
/// Returned when access within the Linux `/proc/` path fails.
81+
///
82+
/// ## `Windows`
83+
/// Returned when the `Win32` API used internally fails.
84+
///
85+
/// ## `Unix`
86+
/// Returned when the `libc` API used internally fails.
7887
pub fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
7988
kill_tree_with_config(process_id, &Config::default())
8089
}

crates/libs/kill_tree/src/core.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub enum Error {
1919
Windows(windows::core::Error),
2020
#[cfg(unix)]
2121
Unix(nix::Error),
22-
#[cfg(feature = "tokio")]
23-
TokioJoin(::tokio::task::JoinError),
2422
}
2523

2624
impl std::fmt::Display for Error {
@@ -46,8 +44,6 @@ impl std::fmt::Display for Error {
4644
Error::Windows(e) => write!(f, "Windows error: {e}"),
4745
#[cfg(unix)]
4846
Error::Unix(e) => write!(f, "Unix error: {e}"),
49-
#[cfg(feature = "tokio")]
50-
Error::TokioJoin(e) => write!(f, "Tokio join error: {e}"),
5147
}
5248
}
5349
}
@@ -139,13 +135,7 @@ pub(crate) mod blocking {
139135

140136
#[cfg(feature = "tokio")]
141137
pub(crate) mod tokio {
142-
use super::{Error, ProcessInfos, Result};
143-
144-
impl From<::tokio::task::JoinError> for Error {
145-
fn from(e: ::tokio::task::JoinError) -> Self {
146-
Error::TokioJoin(e)
147-
}
148-
}
138+
use super::{ProcessInfos, Result};
149139

150140
pub(crate) trait ProcessInfosProvidable {
151141
async fn get_process_infos(&self) -> Result<ProcessInfos>;

crates/libs/kill_tree/src/linux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub(crate) mod blocking {
162162
let status = match std::fs::read_to_string(&status_path) {
163163
Ok(x) => x,
164164
Err(e) => {
165-
return Err(Error::Io(e));
165+
return Err(e.into());
166166
}
167167
};
168168
parse_status(process_id, status_path.display().to_string(), status)

0 commit comments

Comments
 (0)