chipsenkbeil / typed-path

Provides typed variants of Path and PathBuf for Unix and Windows
38 stars 6 forks source link

Support for wasm, or other non-unix or windows targets #21

Closed ryb73 closed 7 months ago

ryb73 commented 7 months ago

I'm attempting to create a WASM library which uses typed-path, but am getting the following error:

error[E0432]: unresolved imports `crate::native::Utf8NativePath`, `crate::native::Utf8NativePathBuf`
  --> [...]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/typed-path-0.7.0/src/convert.rs:10:14
   |
10 |     native::{Utf8NativePath, Utf8NativePathBuf},
   |              ^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^ no `Utf8NativePathBuf` in `native`
   |              |
   |              no `Utf8NativePath` in `native`

From what I can tell it's because Utf8NativePath and Utf8NativePathBuf are only defined for the unix and windows targets, which makes sense.

It'd be nice, though, to be able to use a version of typed-path which omits any usage of Native, since it doesn't really make sense in this context. I'm not familiar enough with Rust (or wasm, for that matter) to intuit the appropriate way to implement this, but if given some direction would be happy to submit a PR.

chipsenkbeil commented 7 months ago

Can you give version 0.7.1 a try?

ryb73 commented 7 months ago

What a quick turnaround – thanks @chipsenkbeil! Looks good to me.