add_to_downgrade_list

Function add_to_downgrade_list 

Source
pub fn add_to_downgrade_list(app: &mut AppState, item: PackageItem)
Expand description

What: Add a PackageItem to the downgrade list if it is not already present.

Inputs:

  • app: Mutable application state (downgrade_list and selection)
  • item: Package to add

Output:

  • Inserts at the front and selects index 0; no-op on dedup.

Details:

  • Ensures repeated requests for the same package keep the cursor anchored at the newest item.
  • Uses HashSet for O(1) membership checking instead of linear scan.