Skip to content

Commit 2ec7e82

Browse files
authored
wasm: Fix operation not supported on std::fs. Closes #115 (#166)
* Add new web-based std::fs replacement, localstoragefs: https://github.com/iceiix/localstoragefs * Add std_or_web to switch between std::fs (native) or localstoragefs (web) * Update www readme for new missing glutin/winit links, opens issue #171
1 parent 880dff0 commit 2ec7e82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

protocol/src/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use aes::Aes128;
1919
use cfb8::Cfb8;
2020
use cfb8::stream_cipher::{NewStreamCipher, StreamCipher};
2121
use serde_json;
22+
use std_or_web::fs;
2223
#[cfg(not(target_arch = "wasm32"))]
2324
use reqwest;
2425

@@ -1070,7 +1071,7 @@ impl Conn {
10701071

10711072
if network_debug {
10721073
debug!("about to parse id={:x}, dir={:?} state={:?}", id, dir, self.state);
1073-
std::fs::File::create("last-packet")?.write_all(buf.get_ref())?;
1074+
fs::File::create("last-packet")?.write_all(buf.get_ref())?;
10741075
}
10751076

10761077
let packet = packet::packet_by_id(self.protocol_version, self.state, dir, id, &mut buf)?;

0 commit comments

Comments
 (0)