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
This commit is contained in:
iceiix 2019-05-29 08:21:56 -07:00 committed by GitHub
parent d7340007a0
commit 8faeb9f5cc
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ use aes::Aes128;
use cfb8::Cfb8;
use cfb8::stream_cipher::{NewStreamCipher, StreamCipher};
use serde_json;
use std_or_web::fs;
#[cfg(not(target_arch = "wasm32"))]
use reqwest;
@ -1070,7 +1071,7 @@ impl Conn {
if network_debug {
debug!("about to parse id={:x}, dir={:?} state={:?}", id, dir, self.state);
std::fs::File::create("last-packet")?.write_all(buf.get_ref())?;
fs::File::create("last-packet")?.write_all(buf.get_ref())?;
}
let packet = packet::packet_by_id(self.protocol_version, self.state, dir, id, &mut buf)?;