(&self, browser: &str, port: u16)
| 527 | } |
| 528 | |
| 529 | fn open_browser(&self, browser: &str, port: u16) -> Result<(), Box<dyn std::error::Error>> { |
| 530 | let url = format!("http://localhost:{}", port); |
| 531 | |
| 532 | #[cfg(target_os = "macos")] |
| 533 | { |
| 534 | Command::new("open") |
| 535 | .args(["-a", browser, &url]) |
| 536 | .spawn()?; |
| 537 | } |
| 538 | |
| 539 | #[cfg(target_os = "linux")] |
| 540 | { |
| 541 | Command::new("xdg-open") |
| 542 | .arg(&url) |
| 543 | .spawn()?; |
| 544 | } |
| 545 | |
| 546 | #[cfg(target_os = "windows")] |
| 547 | { |
| 548 | Command::new("cmd") |
| 549 | .args(["/C", "start", &url]) |
| 550 | .spawn()?; |
| 551 | } |
| 552 | |
| 553 | Ok(()) |
| 554 | } |
| 555 | |
| 556 | fn open_default_browser(&self, port: u16) -> Result<(), Box<dyn std::error::Error>> { |
| 557 | let url = format!("http://localhost:{}", port); |
nothing calls this directly
no outgoing calls
no test coverage detected