utils.rs 441 B

12345678910
  1. #[cfg(feature = "console_error_panic_hook")]
  2. pub fn set_panic_hook() {
  3. // When the `console_error_panic_hook` feature is enabled, we can call the
  4. // `set_panic_hook` function at least once during initialization, and then
  5. // we will get better error messages if our code ever panics.
  6. //
  7. // For more details see
  8. // https://github.com/rustwasm/console_error_panic_hook#readme
  9. console_error_panic_hook::set_once();
  10. }