pub fn find_package_by_name(name: &str) -> Option<PackageItem>Expand description
What: Find a package by name in the official index and return it as a PackageItem.
Inputs:
name: Package name to search for
Output:
Some(PackageItem)if the package is found in the official index,Noneotherwise.
Details:
- Uses the
name_to_idxHashMapfor O(1) lookup by lowercase name. - Falls back to linear scan if
HashMapis empty (e.g., before rebuild).