pub fn is_package_installed_or_provided<S: BuildHasher + Default>(
name: &str,
installed: &HashSet<String, S>,
_provided: &HashSet<String, S>,
) -> boolExpand description
What: Check if a package is installed or provided by an installed package.
Inputs:
name: Package name to check.installed: Set of directly installed package names.provided: Set of package names provided by installed packages (unused, kept for API compatibility).
Output:
- Returns
trueif the package is directly installed or provided by an installed package.
Details:
- First checks if the package is directly installed.
- Then lazily checks if it’s provided by any installed package using
pacman -Qqo. - This handles cases like
rustupprovidingrustefficiently without querying all packages upfront.