Repository: astral-sh/uv
File: crates/uv/src/commands/python/install.rs (Rust)

Code before:
        None
    };

    let installations: Vec<_> = downloaded.iter().chain(satisfied.iter().copied()).collect();

    // Ensure that the installations are _complete_ for both downloaded installations and existing
    // installations that match the request
    for installation in &installations {
        installation.ensure_externally_managed()?;
        installation.ensure_sysconfig_patched()?;
        installation.ensure_canonical_executables()?;
        if let Err(e) = installation.ensure_dylib_patched() {
            e.warn_user(installation);
        }

        if preview.is_disabled() {
            debug!("Skipping installation of Python executables, use `--preview` to enable.");
            continue;
        }

        let bin = bin
            .as_ref()
            .expect("We should have a bin directory with preview enabled")
            .as_path();

        let upgradeable = preview.is_enabled() && is_default_install
            || requested_minor_versions.contains(&installation.key().version().python_version());

        create_bin_links(
            installation,
            bin,
            reinstall,
            force,
            default,
            upgradeable,
            upgrade,
            is_default_install,
            first_request,
            &existing_installations,
            &installations,
            &mut changelog,
            &mut errors,
            preview,
        )?;

        if preview.is_enabled() {
            #[cfg(windows)]
            {
                uv_python::windows_registry::create_registry_entry(installation, &mut errors)?;
            }
        }

Review comment (suggestion):
I removed the `preview.is_enabled()` check since it's redundant (`preview` is used in `create_bin_links` to gate symlink directory creation) and makes this predicate harder to read with this change

Code after:
        None
    };

    let installations: Vec<_> = downloaded.iter().chain(satisfied.iter().copied()).collect();

    // Ensure that the installations are _complete_ for both downloaded installations and existing
    // installations that match the request
    for installation in &installations {
        installation.ensure_externally_managed()?;
        installation.ensure_sysconfig_patched()?;
        installation.ensure_canonical_executables()?;
        if let Err(e) = installation.ensure_dylib_patched() {
            e.warn_user(installation);
        }

        if preview.is_disabled() {
            debug!("Skipping installation of Python executables, use `--preview` to enable.");
            continue;
        }

        let bin = bin
            .as_ref()
            .expect("We should have a bin directory with preview enabled")
            .as_path();

        let upgradeable = (default || is_default_install)
            || requested_minor_versions.contains(&installation.key().version().python_version());

        create_bin_links(
            installation,
            bin,
            reinstall,
            force,
            default,
            upgradeable,
            upgrade,
            is_default_install,
            first_request,
            &existing_installations,
            &installations,
            &mut changelog,
            &mut errors,
            preview,
        )?;

        if preview.is_enabled() {
            #[cfg(windows)]
            {
                uv_python::windows_registry::create_registry_entry(installation, &mut errors)?;
            }
        }