File
Blob: samples/hello-wasm/src/utils.rs
| 1 | use cfg_if::cfg_if; |
| 2 | |
| 3 | cfg_if! { |
| 4 | // https://github.com/rustwasm/console_error_panic_hook#readme |
| 5 | if #[cfg(feature = "console_error_panic_hook")] { |
| 6 | extern crate console_error_panic_hook; |
| 7 | pub use self::console_error_panic_hook::set_once as set_panic_hook; |
| 8 | } else { |
| 9 | #[inline] |
| 10 | pub fn set_panic_hook() {} |
| 11 | } |
| 12 | } |