doukutsu-rs/src/util/browser.rs

14 lines
387 B
Rust
Raw Normal View History

2022-11-21 14:15:51 +00:00
#[cfg(feature = "webbrowser")]
pub use webbrowser::open;
// stub for platforms webbrowser doesn't support, such as Horizon OS
2022-12-01 13:30:59 +00:00
#[cfg(not(any(feature = "webbrowser", target_os = "horizon")))]
2022-11-21 14:15:51 +00:00
pub fn open(_url: &str) -> std::io::Result<()> {
Ok(())
}
2022-12-01 13:30:59 +00:00
#[cfg(target_os = "horizon")]
pub fn open(url: &str) -> std::io::Result<()> {
crate::framework::backend_horizon::web_open(url)
}