aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/wasm_shims.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/wasm_shims.rs')
-rw-r--r--crates/ra_ide_api/src/wasm_shims.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/wasm_shims.rs b/crates/ra_ide_api/src/wasm_shims.rs
new file mode 100644
index 000000000..592dddf44
--- /dev/null
+++ b/crates/ra_ide_api/src/wasm_shims.rs
@@ -0,0 +1,17 @@
1#[cfg(not(feature = "wasm"))]
2pub use std::time::Instant;
3
4#[cfg(feature = "wasm")]
5#[derive(Clone, Copy, Debug)]
6pub struct Instant;
7
8#[cfg(feature = "wasm")]
9impl Instant {
10 pub fn now() -> Self {
11 Self
12 }
13
14 pub fn elapsed(&self) -> std::time::Duration {
15 std::time::Duration::new(0, 0)
16 }
17}