Repository: astral-sh/uv
File: crates/uv/src/lib.rs (Rust)

Code before:
            } = PublishSettings::resolve(args, filesystem);

            commands::publish(
                files,
                publish_url,
                trusted_publishing,
                keyring_provider,
                &environment,
                &client_builder,
                username,
                password,
                check_url,
                index,
                index_locations,
                dry_run,
                &cache,
                printer,
            )
            .await
        }
        Commands::Workspace(WorkspaceNamespace { command }) => match command {
            WorkspaceCommand::Metadata(_args) => {
                commands::metadata(&project_dir, globals.preview, printer).await
            }
            WorkspaceCommand::Dir(args) => {
                commands::dir(&args, &project_dir, globals.preview, printer).await
            }
        },
        Commands::BuildBackend { command } => spawn_blocking(move || match command {
            BuildBackendCommand::BuildSdist { sdist_directory } => {
                commands::build_backend::build_sdist(&sdist_directory)
            }
            BuildBackendCommand::BuildWheel {
                wheel_directory,
                metadata_directory,
            } => commands::build_backend::build_wheel(
                &wheel_directory,
                metadata_directory.as_deref(),
            ),
            BuildBackendCommand::BuildEditable {
                wheel_directory,
                metadata_directory,
            } => commands::build_backend::build_editable(
                &wheel_directory,
                metadata_directory.as_deref(),
            ),
            BuildBackendCommand::GetRequiresForBuildSdist => {
                commands::build_backend::get_requires_for_build_sdist()
            }
            BuildBackendCommand::GetRequiresForBuildWheel => {
                commands::build_backend::get_requires_for_build_wheel()

Review comment (suggestion):
I think it's standard to unpack the args here, I don't think we want to pass the CLI type into implementations (just to be consistent)

Code after:
            } = PublishSettings::resolve(args, filesystem);

            commands::publish(
                files,
                publish_url,
                trusted_publishing,
                keyring_provider,
                &environment,
                &client_builder,
                username,
                password,
                check_url,
                index,
                index_locations,
                dry_run,
                &cache,
                printer,
            )
            .await
        }
        Commands::Workspace(WorkspaceNamespace { command }) => match command {
            WorkspaceCommand::Metadata(_args) => {
                commands::metadata(&project_dir, globals.preview, printer).await
            }
            WorkspaceCommand::Dir(args) => {
                commands::dir(args.package, &project_dir, globals.preview, printer).await
            }
        },
        Commands::BuildBackend { command } => spawn_blocking(move || match command {
            BuildBackendCommand::BuildSdist { sdist_directory } => {
                commands::build_backend::build_sdist(&sdist_directory)
            }
            BuildBackendCommand::BuildWheel {
                wheel_directory,
                metadata_directory,
            } => commands::build_backend::build_wheel(
                &wheel_directory,
                metadata_directory.as_deref(),
            ),
            BuildBackendCommand::BuildEditable {
                wheel_directory,
                metadata_directory,
            } => commands::build_backend::build_editable(
                &wheel_directory,
                metadata_directory.as_deref(),
            ),
            BuildBackendCommand::GetRequiresForBuildSdist => {
                commands::build_backend::get_requires_for_build_sdist()
            }
            BuildBackendCommand::GetRequiresForBuildWheel => {
                commands::build_backend::get_requires_for_build_wheel()