Seeker14491 / opener

Open a file or link in the system default program.
Apache License 2.0
49 stars 10 forks source link

Replace winapi dependency with windows #28

Closed skipkayhil closed 3 months ago

skipkayhil commented 6 months ago

Since normpath was added, opener has depended on both winapi (directly) and windows-sys (transitively).

This commit replaces usage of winapi with the windows crate so that it only depends on a single windows API crate. Additionally, the windows crate includes some functions that were manually linked in opener, so those manual links were able to be cleaned up.


I'm not very experienced with unsafe Rust 😅. Any feedback is appreciated!

skipkayhil commented 6 months ago

Friendly bump 🙂 Anything needed from me?

Seeker14491 commented 5 months ago

I just pushed a commit fixing some style nits. However, I've just realized we're using the windows crate here, while normpath depends on the windows-sys crate, which is actually a totally separate crate (windows does not depend on windows-sys). So we would still be depending on two separate Windows API crates. Two possible solutions:

The first option is simpler, but I believe there's some edge cases where normpath is more compatible with certain paths, so maybe we'd need to go with the second option.

Seeker14491 commented 3 months ago

I've switched over to windows-sys in https://github.com/Seeker14491/opener/pull/29, so now we only have one Windows API crate in our dependency tree.