Skip to main content

resolve_draft

Function resolve_draft 

Source
pub fn resolve_draft<'a>(
    packages: &'a [DraftPackage],
    id: &str,
) -> Result<&'a DraftPackage, DraftResolveError>
Expand description

Resolve a user-supplied draft ID to the matching DraftPackage.

Accepts:

  • Full UUID
  • Shortref/seq (6ebf85ab/1)
  • Legacy display_id prefix (e.g. cbda7f5f-1)
  • UUID prefix (≥4 chars, unambiguous)
  • 8-char all-hex goal shortref (resolves to the latest draft for that goal)
  • Tag match

Returns a reference into packages, or a DraftResolveError.