Skip to content

Commit

Permalink
wasm: Fix operation not supported on std::fs. Closes #115 (#166)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
iceiix authored May 29, 2019
1 parent d64485d commit fbbadb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)?;
Expand Down

0 comments on commit fbbadb0

Please sign in to comment.