-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make open_browser take AsRef<OsStr> #35
Conversation
Welcome, your first PR here :) Moving this to |
@philippeitis gentle ping. |
Hi - I don't really think there is a better alternative, since handling file paths will always require a type from |
@philippeitis, I thought about it. Semantically, I don't think it's correct to expose
Given that it isn't too hard to convert a I do like exposing an |
That's disappointing to hear, and I hope you'll reconsider on some points. The reason I sent this PR is because in general, it is not actually possible to convert a Links: It is nice to be able to open HTML or SVG files in a browser by default, and it would also be nice to be able to take advantage of browser detection to select an available browser. This is my intended use case, and not having access to an In particular, changing the signature of
|
Having an
|
I wanted to use this to open files in the web browser, but as it turns out, it only accepts strings. I was quite surprised to see this, so I added code to allow using anything implementing AsRef instead, which should support both url and filepath usecases.
I have tested this on Unix and it works perfectly. I'd also like to add support for the major browsers on Windows/Unix, as I believe it should be as simple as doing "firefox path" or "chrome path"