Skip to content

Commit 28ed7b9

Browse files
hrkfdnamodm
authored andcommitted
rename previously linux-only function to include BSDs
1 parent 014af16 commit 28ed7b9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Currently state of platform support is:
2828

2929
* macos => default, as well as browsers listed under [Browser](enum.Browser.html)
3030
* windows => default browser only
31-
* linux => default browser only (uses $BROWSER env var, failing back to xdg-open, gvfs-open, gnome-open, whichever works first)
31+
* linux/*bsd => default browser only (uses $BROWSER env var, failing back to xdg-open, gvfs-open, gnome-open, whichever works first)
3232
* android => not supported right now
3333
* ios => not supported right now
3434

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
250250
#[inline]
251251
fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
252252
match browser {
253-
Browser::Default => open_on_linux_using_browser_env(url)
253+
Browser::Default => open_on_unix_using_browser_env(url)
254254
.or_else(|_| -> Result<Output> { Command::new("xdg-open").arg(url).output() })
255255
.or_else(|_| -> Result<Output> { Command::new("gvfs-open").arg(url).output() })
256256
.or_else(|_| -> Result<Output> { Command::new("gnome-open").arg(url).output() }),
@@ -266,7 +266,7 @@ fn open_browser_internal(browser: Browser, url: &str) -> Result<Output> {
266266
target_os = "netbsd",
267267
target_os = "openbsd"
268268
))]
269-
fn open_on_linux_using_browser_env(url: &str) -> Result<Output> {
269+
fn open_on_unix_using_browser_env(url: &str) -> Result<Output> {
270270
let browsers = ::std::env::var("BROWSER")
271271
.map_err(|_| -> Error { Error::new(ErrorKind::NotFound, "BROWSER env not set") })?;
272272
for browser in browsers.split(':') {

0 commit comments

Comments
 (0)