pub fn open_browser(browser_path: &str) {
    // open default browser in Linux
    // for WSL2 in Win10 I used my project https://crates.io/crates/wsl_open_browser

    let x = std::process::Command::new(browser_path)
        .arg(&format!(
            "http://{}:{}/{}/index.html",
            SERVER_HOST.as_str(),
            SERVER_PORT.as_str(),
            SERVER_FIRST_SUBDIRECTORY.as_str()
        ))
        .spawn()
        .expect(&format!(
            "Failed to open default browser using `{}`. 
        Probably it is not preinstalled on your Linux distro. Try to instal it with `xdg-utils`. 
        Or you can change the default browser command in the Config menu.
        Or you can set the env variable `export CREV_BROWSER_PATH=/usr/bin/xdg-open`.",
            browser_path
        ));
    drop(x);
}
/// open browser with xdg-open
/// it is read from env variable CREV_BROWSER_PATH
/// or from the config item in the db_sled metadata tree
open browser with xdg-open
it is read from env variable CREV_BROWSER_PATH
or from the config item in the db_sled metadata tree
open browser with xdg - open it is read from env variable CREV_BROWSER_PATH or from the config item in the db_sled metadata tree
pub fn open_browser(browser_path: &str) {
    // open default browser in Linux
    // for WSL2 in Win10 I used my project https://crates.io/crates/wsl_open_browser
    let x = std::process::Command::new(browser_path)
        .arg(&format!(
            "http://{}:{}/{}/index.html",
            SERVER_HOST.as_str(),
            SERVER_PORT.as_str(),
            SERVER_FIRST_SUBDIRECTORY.as_str()
        ))
        .spawn()
        .expect(&format!(
            "Failed to open default browser using `{}`. 
        Probably it is not preinstalled on your Linux distro. Try to instal it with `xdg-utils`. 
        Or you can change the default browser command in the Config menu.
        Or you can set the env variable `export CREV_BROWSER_PATH=/usr/bin/xdg-open`.",
            browser_path
        ));
    drop(x);
}
pub fn open_browser ( browser_path : & str ) { // open default browser in Linux // for WSL2 in Win10 I used my project https://crates.io/crates/wsl_open_browser let x = std :: process :: Command :: new ( browser_path ) . arg ( & format ! ( " " SERVER_HOST as_str ( ) SERVER_PORT as_str ( ) SERVER_FIRST_SUBDIRECTORY as_str ( ) ) ) . spawn ( ) . expect ( & format ! ( " " browser_path ) ) ; drop ( x ) ; }
open browser with xdg-open
it is read from env variable CREV_BROWSER_PATH
or from the config item in the db_sled metadata tree
open browser with xdg - open it is read from env variable CREV_BROWSER_PATH or from the config item in the db_sled metadata tree
browser_path
&str