yewでタイマーを作ってみる
$ cargo new --lib yew-timer && cd yew-timer
$ wasm-pack build --target web --out-name wasm --out-dir ./static/wasm
$ miniserve ./static --index index.html
$ rustup show
ランタイムエラーは表示されるが、詳細からどこに問題が起きているか追えない。 console_error_panic_hook を使うと詳細が見えるようになる
以下にもそれっぽいこと書いてある。 https://stackoverflow.com/questions/63210984/chrono-kills-my-rust-webassembly-function
chronoを使うのをやめて、js-sys で現在時刻を取得するようにして回避した
以下を見て解決。
いっつも引っかかってる気がする。
https://stackoverflow.com/questions/23975391/how-to-convert-a-string-into-a-static-str