MCPcopy Index your code
hub / github.com/algoscienceacademy/RustUI / open_default_browser

Method open_default_browser

src/dev_server.rs:556–567  ·  view source on GitHub ↗
(&self, port: u16)

Source from the content-addressed store, hash-verified

554 }
555
556 fn open_default_browser(&self, port: u16) -> Result<(), Box<dyn std::error::Error>> {
557 let url = format!("http://localhost:{}", port);
558
559 #[cfg(target_os = "macos")]
560 Command::new("open").arg(&url).spawn()?;
561 #[cfg(target_os = "linux")]
562 Command::new("xdg-open").arg(&url).spawn()?;
563 #[cfg(target_os = "windows")]
564 Command::new("cmd").args(["/C", "start", &url]).spawn()?;
565
566 Ok(())
567 }
568
569 fn cleanup_platform(&mut self, platform: Platform) {
570 self.simulator_windows.retain_mut(|window| {

Callers 1

start_web_serverMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected