Skip to content

Commit 0a7aa9d

Browse files
authored
Switch back to env::args_os (#22763)
Signed-off-by: William Woodruff <[email protected]>
1 parent 5bae848 commit 0a7aa9d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎crates/uv-build/src/main.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ fn main() -> Result<()> {
3030
.init();
3131

3232
// Handrolled to avoid the large clap dependency
33-
let mut args = env::args();
33+
let mut args = env::args_os();
3434
// Skip the name of the binary
3535
args.next();
3636
let command = args.next().context("Missing command")?;
37+
let command = command.to_str().context("Invalid non-UTF8 command")?;
3738

3839
// Ad-hoc preview features parsing due to a lack of clap CLI in uv-build.
3940
let preview = if parse_boolish_environment_variable(EnvVars::UV_PREVIEW)?.unwrap_or(false) {
@@ -61,7 +62,7 @@ fn main() -> Result<()> {
6162
// Errors returned by finalize are self-describing, but should also be impossible.
6263
uv_preview::finalize().unwrap();
6364

64-
match command.as_str() {
65+
match command {
6566
"build-sdist" => {
6667
let sdist_directory = PathBuf::from(args.next().context("Missing sdist directory")?);
6768
let filename = uv_build_backend::build_source_dist(

0 commit comments

Comments
 (0)