Skip to content

Commit

Permalink
Enable h2 to be able to run in browser environment.
Browse files Browse the repository at this point in the history
This replaces Instant by a more generate wasm_timer::Instant.
  • Loading branch information
boxdot committed Feb 2, 2021
1 parent eec547d commit f6ae28c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ tracing-futures = { version = "0.2", default-features = false, features = ["std-
fnv = "1.0.5"
slab = "0.4.2"
indexmap = "1.0"
wasm-timer = { version = "0.2.5" }

[dev-dependencies]

Expand Down
3 changes: 2 additions & 1 deletion src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use crate::{frame, proto};
use std::task::Context;

use http::{HeaderMap, Request, Response};
use wasm_timer::Instant;

use std::io;
use std::task::{Poll, Waker};
use std::time::{Duration, Instant};
use std::time::Duration;

#[derive(Debug)]
pub(super) struct Recv {
Expand Down
3 changes: 2 additions & 1 deletion src/proto/streams/stream.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::*;

use wasm_timer::Instant;

use std::task::{Context, Waker};
use std::time::Instant;
use std::usize;

/// Tracks Stream related state
Expand Down

0 comments on commit f6ae28c

Please sign in to comment.