Skip to main content

branch_creation_command

Function branch_creation_command 

Source
pub fn branch_creation_command(word: &[u8]) -> Option<BranchCreationCommand>
Expand description

What: The guarded command a subcommand word names, or nothing. &[u8] borrows the word. Why: Callers hold the subcommand token as raw bytes.

In TS you’d write (pseudocode):

const guarded = ['branch', 'checkout', 'switch'].includes(word) ? word : undefined;