about summary refs log tree commit diff
path: root/src/expr.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-09-09 11:12:13 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-09-09 11:13:15 -0700
commit46e2a2e7c76dbc6ada09ee815a440701d6aeaba9 (patch)
treefa56c01aae2cf7615376095666b2a6e43df1f1d7 /src/expr.rs
parent6ada5b51ccfd99a91055dfc3b411e83f2e0514d5 (diff)
Support platforms without a timer
I've dabbled recently in seeing how hard it would be to compile rustfmt to wasm
and then run it in a web browser, and it turns out that it's [not too
hard][wasm]! In addition to patching a few dependencies which already have a
number of patches out rustfmt also needed some modifications to get it to work,
namely avoiding the usage of `Instant::now()` on the "happy path" which doesn't
work on wasm (it just panics).

This commit is an attempt to add a support for this by avoiding using
`Instant::now()` on the wasm target, but panicking if the actual time elapsed is
requested (which doesn't happen unless verbosely logging I believe).

[wasm]: https://alexcrichton.github.io/rustfmt-wasm/
Diffstat (limited to 'src/expr.rs')
0 files changed, 0 insertions, 0 deletions