diff options
author | Aleksey Kladov <[email protected]> | 2020-02-06 11:43:56 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-06 11:43:56 +0000 |
commit | 939f05f3e33e9f00d5205d60af3a862ae4d58bd6 (patch) | |
tree | 5de7e04d907c8e1cb0e101529abaad3d6f7beba3 /crates/ra_ide_db/src/wasm_shims.rs | |
parent | 1bfb111cf9ab938a8795f1ad2089cdd8b8c4b7a5 (diff) |
Move to a crate
Diffstat (limited to 'crates/ra_ide_db/src/wasm_shims.rs')
-rw-r--r-- | crates/ra_ide_db/src/wasm_shims.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_ide_db/src/wasm_shims.rs b/crates/ra_ide_db/src/wasm_shims.rs new file mode 100644 index 000000000..088cc9be4 --- /dev/null +++ b/crates/ra_ide_db/src/wasm_shims.rs | |||
@@ -0,0 +1,19 @@ | |||
1 | //! FIXME: write short doc here | ||
2 | |||
3 | #[cfg(not(feature = "wasm"))] | ||
4 | pub use std::time::Instant; | ||
5 | |||
6 | #[cfg(feature = "wasm")] | ||
7 | #[derive(Clone, Copy, Debug)] | ||
8 | pub struct Instant; | ||
9 | |||
10 | #[cfg(feature = "wasm")] | ||
11 | impl Instant { | ||
12 | pub fn now() -> Self { | ||
13 | Self | ||
14 | } | ||
15 | |||
16 | pub fn elapsed(&self) -> std::time::Duration { | ||
17 | std::time::Duration::new(0, 0) | ||
18 | } | ||
19 | } | ||