Skip to content

Commit

Permalink
chore: change doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
oneofthezombies committed Feb 12, 2024
1 parent 07a4a56 commit 9f59c16
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions crates/libs/kill_tree/src/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ use crate::windows as imp;
/// use kill_tree::{blocking::kill_tree, get_available_max_process_id, Result};
///
/// fn main() -> Result<()> {
/// let _ = kill_tree(get_available_max_process_id())?;
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let _ = kill_tree(target_process_id)?;
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -70,11 +71,12 @@ pub fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
/// };
///
/// fn main() -> Result<()> {
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let config = Config {
/// signal: String::from("SIGKILL"),
/// ..Default::default()
/// };
/// let _ = kill_tree_with_config(get_available_max_process_id(), &config)?;
/// let _ = kill_tree_with_config(target_process_id, &config)?;
/// Ok(())
/// }
/// ```
Expand All @@ -86,11 +88,12 @@ pub fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
/// };
///
/// fn main() -> Result<()> {
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let config = Config {
/// include_target: false,
/// ..Default::default()
/// };
/// let _ = kill_tree_with_config(get_available_max_process_id(), &config)?;
/// let _ = kill_tree_with_config(target_process_id, &config)?;
/// Ok(())
/// }
/// ```
Expand Down
9 changes: 6 additions & 3 deletions crates/libs/kill_tree/src/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use crate::windows as imp;
///
/// #[tokio::main]
/// async fn main() -> Result<()> {
/// let _ = kill_tree(get_available_max_process_id()).await?;
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let _ = kill_tree(target_process_id).await?;
/// Ok(())
/// }
/// ```
Expand Down Expand Up @@ -70,11 +71,12 @@ pub async fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
///
/// #[tokio::main]
/// async fn main() -> Result<()> {
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let config = Config {
/// signal: String::from("SIGKILL"),
/// ..Default::default()
/// };
/// let _ = kill_tree_with_config(get_available_max_process_id(), &config).await?;
/// let _ = kill_tree_with_config(target_process_id, &config).await?;
/// Ok(())
/// }
/// ```
Expand All @@ -85,11 +87,12 @@ pub async fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
///
/// #[tokio::main]
/// async fn main() -> Result<()> {
/// let target_process_id = get_available_max_process_id(); // Replace with your target process ID.
/// let config = Config {
/// include_target: false,
/// ..Default::default()
/// };
/// let _ = kill_tree_with_config(get_available_max_process_id(), &config).await?;
/// let _ = kill_tree_with_config(target_process_id, &config).await?;
/// Ok(())
/// }
/// ```
Expand Down

0 comments on commit 9f59c16

Please sign in to comment.