From 9ab270b6817a4e48763b8ac1bbc0774fce048e63 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 27 Jun 2023 10:16:30 +0200 Subject: [PATCH] Add proper deprecation marker --- src/lib.rs | 2 +- src/spawn.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 74f8b59..17c8e6a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,7 +49,7 @@ mod spawn; pub use crate::cargo::{get_cargo_bin, get_cargo_example}; pub use crate::spawn::{Spawn, SpawnExt}; -#[deprecated = "Use .pass_stdin(...) instead"] +#[allow(deprecated)] pub use crate::spawn::StdinCommand; pub use std::process::Command; diff --git a/src/spawn.rs b/src/spawn.rs index f08f51f..3866d29 100644 --- a/src/spawn.rs +++ b/src/spawn.rs @@ -113,11 +113,13 @@ impl<'a> Spawn for &'a mut Command { } /// Like [`Command`] but sends some input to stdin. +#[deprecated = "Use .pass_stdin(...) instead"] pub struct StdinCommand { command: Command, stdin: Vec, } +#[allow(deprecated)] impl StdinCommand { /// Creates a new command that also gets some input value fed to stdin. pub fn new, I: Into>>(program: S, stdin: I) -> StdinCommand { @@ -132,6 +134,7 @@ impl StdinCommand { } } +#[allow(deprecated)] impl Deref for StdinCommand { type Target = Command; @@ -140,12 +143,14 @@ impl Deref for StdinCommand { } } +#[allow(deprecated)] impl DerefMut for StdinCommand { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.command } } +#[allow(deprecated)] impl Spawn for StdinCommand { fn spawn_with_info(&mut self, stdin: Option>) -> (Info, Output) { Command::spawn_with_info(