INNER CODE UNIT · Rust

parse_auth_arg

TheWaWaR/simple-http-server · src/config.rs:521

fn parse_auth_arg(value: &str) -> Result<String, String> {
    parse_auth(value).map(|_| value.to_owned())
}

#[cfg(target_os = "windows")]
pub(crate) fn open_in_browser(url: &str) -> io::Result<()> {
    command_status(ProcessCommand::new("cmd").args(["/C", "start", "", url]))
}

#[cfg(target_os = "macos")]
pub(crate) fn open_in_browser(url: &str) -> io::Result<()> {
    command_status(ProcessCommand::new("open").arg(url))
}

#[cfg(all(unix, not(target_os = "macos")))]
pub(crate) fn open_in_browser(url: &str) -> io::Result<()> {
    command_status(ProcessCommand::new("xdg-open").arg(url))
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…