Skip to content

Commit 45d1780

Browse files
committed
Revert "implement std::process::Command::args_new()"
This reverts commit 626d0e71b1e82c4804cec1a2bd03c3c53e4368ad. * removes 'args_new()' as requested in #87420 (comment) * still disallow argv0 mutation as I explained in #87420 (comment)
1 parent 9d69f08 commit 45d1780

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

library/std/src/process.rs

-42
Original file line numberDiff line numberDiff line change
@@ -717,48 +717,6 @@ impl Command {
717717
self
718718
}
719719

720-
/// Reset the argument list to new content
721-
///
722-
/// Allows to maintain the argument list in a Vec or anything else that can provide
723-
/// a suitable iterator.
724-
///
725-
/// # Examples
726-
///
727-
/// Basic usage:
728-
///
729-
/// ```no_run
730-
/// #![feature(mutate_command_args)]
731-
/// use std::process::Command;
732-
///
733-
/// // Prepare a command
734-
/// let mut command = Command::new("ls");
735-
/// let mut my_args = Vec::from(["-l", "foo"]);
736-
///
737-
/// command
738-
/// .args_new(&my_args)
739-
/// .spawn()
740-
/// .unwrap();
741-
///
742-
/// // Mutate my_args
743-
/// my_args.insert(1, "-a");
744-
/// my_args.pop();
745-
/// my_args.push("bar");
746-
///
747-
/// // Run command again with the mutated arguments
748-
/// command
749-
/// .args_new(&my_args)
750-
/// .spawn()
751-
/// .unwrap();
752-
/// ```
753-
#[unstable(feature = "mutate_command_args", issue = "87379")]
754-
pub fn args_new<I, S>(&mut self, args: I) -> &mut Command
755-
where
756-
I: IntoIterator<Item = S>,
757-
S: AsRef<OsStr>,
758-
{
759-
self.args_clear().args(args)
760-
}
761-
762720
/// Inserts or updates an environment variable mapping.
763721
///
764722
/// Note that environment variable names are case-insensitive (but case-preserving) on Windows,

0 commit comments

Comments
 (0)