From d13ecfb91d991a7ba8832dae3f8e0d1fd930184f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=B6ln?= Date: Tue, 12 Jun 2018 19:44:39 +0200 Subject: [PATCH] seralize Path/PathBuf as &str/String for wasm32 --- src/serialize.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serialize.rs b/src/serialize.rs index 296f3d4..f756047 100644 --- a/src/serialize.rs +++ b/src/serialize.rs @@ -1356,7 +1356,7 @@ array! { } impl Encodable for path::Path { - #[cfg(target_os = "redox")] + #[cfg(any(target_os = "redox", target_arch = "wasm32"))] fn encode(&self, e: &mut S) -> Result<(), S::Error> { self.as_os_str().to_str().unwrap().encode(e) } @@ -1380,7 +1380,7 @@ impl Encodable for path::PathBuf { } impl Decodable for path::PathBuf { - #[cfg(target_os = "redox")] + #[cfg(any(target_os = "redox", target_arch = "wasm32"))] fn decode(d: &mut D) -> Result { let string: String = try!(Decodable::decode(d)); let s: OsString = OsString::from(string);