Skip to content

Instantly share code, notes, and snippets.

@LironHazan
Created October 18, 2020 05:33
Show Gist options
  • Save LironHazan/00089100c4e10c245986f82bd5f35bec to your computer and use it in GitHub Desktop.
Save LironHazan/00089100c4e10c245986f82bd5f35bec to your computer and use it in GitHub Desktop.
snippet 6 for post
// Opens chrome once the server starts
async fn open_web_app(url: &str) -> () {
use std::process::Command;
let mut cmd = Command::new("open");
cmd.arg("-a")
.arg("Google Chrome")
.arg(format!("http://{}", url))
.spawn()
.expect("failed to spawn child");
println!("{}", url)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment