process: upgrade Command::spawn_with to use FnOnce (#7511)

This commit is contained in:
Michael Zhao 2025-08-03 11:27:37 -07:00 committed by GitHub
parent f1d3b065b6
commit 2403b91d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -933,7 +933,7 @@ impl Command {
#[inline]
pub fn spawn_with(
&mut self,
with: impl Fn(&mut StdCommand) -> io::Result<StdChild>,
with: impl FnOnce(&mut StdCommand) -> io::Result<StdChild>,
) -> io::Result<Child> {
// On two lines to circumvent a mutable borrow check failure.
let child = with(&mut self.std)?;