Skip to main content

strip_tab

Function strip_tab 

Source
pub fn strip_tab(raw: &str, tab: Option<&str>) -> String
Expand description

Strip a /<tab> suffix from a raw <browser>[/<tab>] positional.

tab is the tab name already parsed out of raw (via crate::cli::env_resolver::parse_target). When Some, the matching /<name> suffix is removed; if raw doesn’t actually end in that suffix the original is returned unchanged (defensive — the caller derives tab from the same raw, so a mismatch shouldn’t happen).