Corrected minor non-idiomatic snippet of code (#3108)

* Corrected minor non-idiomaticity.

* Added to CONTRIBUTORS.
This commit is contained in:
jthulhu 2024-04-01 12:34:23 +02:00 committed by GitHub
parent 7121cb5132
commit 3cd8c5700b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -169,6 +169,7 @@ Vasll <github.com/vasll>
laalsaas <laalsaas@systemli.org>
ijqq <ijqq@protonmail.ch>
AntoineQ1 <https://github.com/AntoineQ1>
jthulhu <https://github.com/jthulhu>
********************
The text of the 3 clause BSD license follows:

View File

@ -2,6 +2,7 @@
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
use std::ffi::OsStr;
use std::iter::once;
use std::process::Command;
use std::string::FromUtf8Error;
@ -96,8 +97,7 @@ impl CommandExt for Command {
}
fn get_cmdline(arg: &mut Command) -> String {
[arg.get_program().to_string_lossy()]
.into_iter()
once(arg.get_program().to_string_lossy())
.chain(arg.get_args().map(|arg| arg.to_string_lossy()))
.join(" ")
}