Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 893a0d0

Browse files
committed
unimplemented encode/decode implementations for wasm
The cfg() guards around the encode/decode implementations result in the crate being unusable on wasm32-unknown-unknown. These lines don't implement the functionality for that platform (there is file system equivalent there), which makes the crate usable again for file system unrelated tasks like encoding using the "cbor" crate.
1 parent 71b8d6e commit 893a0d0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/serialize.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,6 +1371,10 @@ impl Encodable for path::Path {
13711371
let v = self.as_os_str().encode_wide().collect::<Vec<_>>();
13721372
v.encode(e)
13731373
}
1374+
#[cfg(target_arch = "wasm32")]
1375+
fn encode<S: Encoder>(&self, _e: &mut S) -> Result<(), S::Error> {
1376+
unimplemented!();
1377+
}
13741378
}
13751379

13761380
impl Encodable for path::PathBuf {
@@ -1406,6 +1410,10 @@ impl Decodable for path::PathBuf {
14061410
p.push(s);
14071411
Ok(p)
14081412
}
1413+
#[cfg(target_arch = "wasm32")]
1414+
fn decode<D: Decoder>(_d: &mut D) -> Result<path::PathBuf, D::Error> {
1415+
unimplemented!();
1416+
}
14091417
}
14101418

14111419
impl<T: Encodable + Copy> Encodable for Cell<T> {

0 commit comments

Comments
 (0)